Questions tagged [tcpdf]
TCPDF is a PHP class created by Nicola Asuni for generating PDF documents without requiring external extensions. TCPDF Supports UTF-8, Unicode, RTL languages, XHTML, Javascript, digital signatures, barcodes and much more. It is a fork of FPDF.
2,170
questions
0
votes
0
answers
4
views
How use alternative font with writeHTMLCell
I am using TCPDF library and I would like to use a different font after setting "setFont".
PS: in the following example Titillium font has already been converted to tcpdf.
This is my code:
$...
0
votes
0
answers
7
views
TCPDF how to prevent last empty page in some cases
when i create via PHP a pdf using TCPDF, some times i get a last empty page body (so header and footer printed, but body empty).
It appened when i print different rows of text and the latest row is ...
0
votes
0
answers
10
views
Add Pi Chats or SVG to HTML template through Queue PHP Laravel using TCPDF
I want to add some svg and pi charts in my HTML template. I am doing these to using laravel queues. The main problem is svgs are not rendered by html templates.
$donut = new Donut(
[
...
-1
votes
0
answers
22
views
create a pdf certificate valid key for TCPDF
i try to create a signature certifications key and use him with this 3Party packege
https://github.com/tecnickcom/TCPDF
but all the time i get a InValid signature certifications
on adobe reader
i need ...
1
vote
1
answer
21
views
Dynamic text on TCPDF-Laravel footer
First of all I'm 90% sure this is me not knowing some basic stuff about how php static methods work, so please forgive my ignorance. I also could not find any info on this on SO, so hopefully this won'...
-1
votes
0
answers
47
views
How to use TCPDF to generate a Code128 1D barcode with text below
I found this helpful thread at How to use TCPDF to generate a PDF417 2D barcode? and based on Jono's help I was able to make the code to generate the 2D PDF417 and QRCode now successfully.
However, I ...
0
votes
0
answers
22
views
Generate PDF with TCPDF Library in Wordpress after Saving a Post
I'm writing this thread because I cannot figure out why the code I've implemented in my Wordpress website doesn't generate the PDF using the TCPDF Library:
The library is inside the file manager and ...
1
vote
0
answers
29
views
How can I generate PDFs with the language “Khmer”?
For an international website with bilingual picture books, we would like to generate PDFs also translated into Khmer.
Currently we are using “tcpdf” to generate the PDFs, and the fonts Noto Khmer and ...
0
votes
0
answers
11
views
Use GetStringWidth of TCPDF for japanese characters
I want to get the width of each japanese character inside a string to avoid being cut inside th pdf. However it gives me this error.
array_map(): Argument #2 ($array) must be of type array, bool ...
0
votes
0
answers
26
views
How to get the current font and size that was set in TCPDF?
I wanna get the current font path and size from tcpdf to pass to this function
imagettfbbox(
float $size,
float $angle,
string $font_filename,
string $string,
array $options = []
): array|false
I ...
-2
votes
0
answers
18
views
creation of csv within TCPDF
when I create a pdf with TCPDF, can I then create a csv in the same script with the data of the pdf? Is that possible? Or would that code be ingnored?
When I test my code it looks like it is ingnored ...
0
votes
0
answers
61
views
use gujarati fonts shruti with tcpdf
I want to use gujarati fonts in pdf. I used TCPDF V6.4.4. I am using google indic for input gujarati text. My php version is 8.0. I put shruti fonts into fonts folder. I wrote these code.
require_once(...
0
votes
0
answers
38
views
TCPDF to produce same binary output (no realtime dependencies)
I have a server with limited storage. The idea is to store a document as HTML and convert it to PDF only for download purposes, but not store it.
I can create a PDF with TCPDF each time a PDF is ...
0
votes
0
answers
30
views
PHP TCPDF Font Size in MM
in this moment i spend many hours to find a solution to scale a Text in TCPDF in mm.
Is it possible to scale a Text to 190mm width and automatic high?
I need only one Word that is every time scaled to ...
0
votes
0
answers
26
views
TCPDF - SVG - How to align encapsulated tspans in a container tspan
I'm using TCPDF 6.3 and when printing I can't get the same result as on screen for my SVG. On the screen, the nested tspans are organized natively in inline-block, so they remain well aligned and ...
1
vote
1
answer
38
views
TCPDF background color
is there any way possible to color the cell of TCPDF table only if it has some data. look at the below image I wanna color blocks gray only if it has some data
code image below
0
votes
1
answer
31
views
TCPDF custom font errors
I am using TCPDF 6.6.0 to create a document using custom fonts. When I run my program on my local webserver (on my computer), everything works fine. But when I deploy it to a remote webserver, TCPDF ...
1
vote
0
answers
51
views
Custom font not displaying correctly in TCPDF
I am using TCPDF to create customised PDF certificates upon course completion on Moodle.
My fonts were originally OTF, which I have since converted to TTF to then get the .php, .z and .ctg.z files ...
0
votes
1
answer
30
views
TCPDF with different rendering classes and merging
currently I'm rendering PDFs with TCPDF in Laravel 9 (PHP8.1) for labels for products. The PDF contains many pages, depends on the selected products. I start a TCPDF and do a addPage() per product and ...
0
votes
0
answers
24
views
How to set SetAutoPageBreak in TCPDF - dynamic footer height and custom font?
I want to create a footer that will be text or an image sent from the form. In the footer function, I bind getY - the size and want to return it to the SetAutoPageBreak function outside the class. how ...
0
votes
0
answers
42
views
is there a way to see the radio button outline? TcPDF
this is my code
$this->RadioButton('per1ND',3, array('readonly' => 'true'));
I just want to see a outline on the radio button
For example:
Edit: I noticed that this issue only happens when I ...
1
vote
1
answer
35
views
tcpdf if cell bigger than free space jump to new page
Hi i need a way to make content create in new page if it bigger than page free area
1
vote
0
answers
51
views
JPEG image not rendering completely or at all
I have to move an old script to a new server. The script generates a pdf file with a list of products with some related data and product image. After moving all files to new server and adapting to new ...
0
votes
0
answers
114
views
Can i use a "template.html" with TCPDF
I have found an example online using DomPDF and a template.html file on an invoice that is verry handy.
is there a way to do the same with TCPDF?
I have a form that generates a table with dynamic ...
-1
votes
1
answer
218
views
How to generate a report in a pdf or word format on a webpage?
I have a html/php code as shown below which on click of a download button at Line Z executes a php file. The drop-down list which I have from the select element at Line A is:
Hi
Hello
Good Morning
...
0
votes
0
answers
75
views
php merge pdf files into main pdf with FPDI and TCPDF
I can render the PDF in normal conditions, but I want to merge other pdf files to my main pdf file. So I added a bit of code. (check the section in my code: PART THAT CRASHES MY PDF.....)
the PHP ...
0
votes
0
answers
279
views
Deprecated: Invalid characters passed for attempted conversion [PHP, TCPDF, hexdec()]
I've incorporated tcpdf into a php file (I'm using this exact example: https://tcpdf.org/examples/example_006/) and in trying to generate the pdf I'm getting the following error:
Deprecated: Invalid ...
0
votes
0
answers
19
views
Text-Element with unwanted margins by TCPDF
I'm struggling with some additional margins
$pageLayout = [
$width,
$height,
];
$pdf = new TCPDF('L, 'mm', $pageLayout, TRUE, 'UTF-8', FALSE);
$pdf->setCellPaddings(...
1
vote
1
answer
90
views
Is it possible to include / embed a TCPDF document on a html webpage?
I am having a problem. I am wanting to use html2canvas to print a PDF (generated by TCPDF) which has been embedded on a page.
Sorry for the very bad drawing, but the PDF needs to be embedded in the ...
0
votes
1
answer
86
views
TCPDF - Force break page for group of N rows if exceeded the end
I'm using TCPDF to render list of products and their available SKUs.
As the attached image below:
"Product name" (P1) will be displayed in a row.
"N of SKUs" (P2) will be ...
0
votes
1
answer
177
views
Undefined array key "startcolumn"
I want to display a group of fields in TCPDF. I can display them by this code (without TCPDF) :
<?php $i = 1; ?>
<?php foreach ( $group as $v) : ?> ...
0
votes
0
answers
40
views
TCPDF Line Graph
I am trying to code a line graphic by using TCPDF. I collocated more than 30 blocks and I can add explanation parts under first 22 blocks. But I have to pass to the other page to add explanation parts ...
0
votes
1
answer
49
views
no commands found in cpdf
I'm trying to use cpdf to edit a pdf document. Specifically, I'm trying to rescale the page size by using the command
cpdf -scale-page "2 2" in.pdf -o out.pdf
found in the documentation (...
0
votes
0
answers
21
views
Character problem in phpword tcpdf pdf conversion
<?php
require_once 'vendor/autoload.php';
$objReader= \PhpOffice\PhpWord\IOFactory::createReader('Word2007');
$contents=$objReader->load("helloWorld.docx");
$rendername= \PhpOffice\...
0
votes
0
answers
60
views
Invoicing on an e-commerce website: how on earth SHOULD it work?
TLDR; Should the invoice / receipts files be stored and accumulated on the server, or re-generated on demand server-side every time a client asks to see one ?
I may be horrifying a few with such a ...
0
votes
0
answers
324
views
PHP TCPDF Output does not work, Cant Download PDF, No Errors are displayed
The Output in TCPDF doesnt work in my Code. There are also no Errors?
$pdf->Output('example.pdf', 'D');
The Only Parameter that seems to work is 'F' (It allows the generated pdf to be saved as a ...
0
votes
0
answers
13
views
TCPDF i wanted to table break in well manner
TCPDF:
I wanted to break the table after 45 rows, for that I used HTML tag,
By adding this code, the table breaks but it takes the complete table row as you can see in the screenshot. I wanted to ...
0
votes
0
answers
28
views
TCPDF: Stretching an image taller than the page height
Objective: I am in need of creating a PDF document (or a few) with full-page textured JPG backgrounds. One page for each image background (100+ pages). The images must be stretched maintaining their ...
0
votes
1
answer
238
views
Padding and border-radius not working in TCPDF PDF
Well, I am creating PDF using tcpdf in Laravel, so I want to apply padding and border -radius but these are not applying to PDF.
I want to make a notification circle the same as Facebook notification.
...
1
vote
1
answer
56
views
ImageSVG TCPDF can't render text filled with linearGradient
I have an SVG file like this and I use it for export and PDF with TCPDF ImageSVG function. But somehow, the output PDF looks like this https://prnt.sc/UicMONwIAQTZ. Background gradient color replace ...
0
votes
0
answers
833
views
Why does Fpdi fail to extend TCPDF when using PHP8.1?
I'm using:
TCPDF version 6.4.4.
FPDI version 2.3.6
PHP Version 8.1.7 (Running on Apache and Windows Server 2012,a dev environment)
And, I don't think it's relevant but I'm also using
tcpdf-extension
...
0
votes
0
answers
121
views
How to download dynamically generated multiple pdfs using tcpdf at same time
So I'm using Laravel
I have used tcpdf library to generate pdfs
I used foreach loop to generate a pdf for each iteration and at the last of each iteration download the pdf line added
So I want to ...
0
votes
0
answers
96
views
TCPDF: how to handle HTML table with split row + image? Adobe Acrobat reader crashes
here is an example, it's a table on two pages with headings (<th>); first page is fine, however the last row of the first page has a tall cell that needs to be split over two pages, it contains ...
0
votes
1
answer
89
views
TCPDF page size in php
Hello i'm using tcpdf to generate a file with : 5.8 cm in the width. but my code is not working :
this is the code :
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', ...
-1
votes
2
answers
74
views
Can I add a password hint to protected pdf file?
I am using tfpdf for creating a file and at certain stage I am using the Tcpdi library to load the file and protect it with password.
is there any way to set a password hint?
like: the password is ...
0
votes
0
answers
31
views
How to insert multiple backgrounds when there are multiple pages table of contents with TCPDF
// Add a new page for TOC
$pdf->addTOCPage();
$pdf->Ln(14);
$pdf->setFont($fontname, '', 14);
//Set background page 1
$pdf->SetAutoPageBreak(false, 0);
$img_file1 = FILE_PATH.'/number/3-...
-1
votes
1
answer
265
views
How can I add link on pdf with TCPDF using cell method?
I'm trying to create an external link on pdf file generated by TCPDF library using Cell method. I've written code something like this:
$this->pdf = new PDF();
$this->pdf->Cell(20, 10, 'Click ...
0
votes
1
answer
77
views
Receive unexpected output from TCPDF
I am using TCPDF with Laravel.
while using $tcpdf->Output() it showing me some object of tcpdf
Output:
This is what I got as output
0
votes
0
answers
26
views
Adding Username in TCPDF
I have a project wherein the reports are in pdf. The pdf displays all the records I have in the database which is working really well already. I even display the date when it was generated. What I can'...
1
vote
0
answers
23
views
How to Set the WriteHTMLCell height same as the preceding cells TCPDF
I wonder how to set the height of the proceeding cells same as the first cell in WriteHTMLCells like this one
WriteHTMLCell Image Sample
Here is my Code
foreach($infosp as $item) {
$pdf->...