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.

Resources

2193 questions
20
votes
3 answers

PHP / TCPDF: Template Bug?

I have been using TCPDF for sometime. It's simple to use, outputs low size PDF and is under active development. Following is the code for a page which should only have Hello World and a footer showing page number. However I get an additional…
abel
  • 2,377
  • 9
  • 39
  • 62
19
votes
5 answers

How to put column headings of a table on each page in tcpdf?

The code used to print the pdf is as follows: class MYPDF extends TCPDF { // Load table data from file public function LoadData($file) { // Read file lines $lines = file($file); $data = array(); …
PHPLover
  • 1
  • 51
  • 158
  • 311
18
votes
2 answers

How to create TCPDF HTML table with variable row paddings

I'm trying to create an HTML table in TCPDF, with few rows having grater space between rows (padding), and others having smaller padding. $html = '
' .…
Bero_zg
  • 303
  • 1
  • 3
  • 9
18
votes
4 answers

Creating PDF with tcpdf shows blank on iphone

I am using tcpdf to produce PDF's from HTML. Everything is working fine and when I view the PDF on my computer I can see it just fine, but for some reason when I look at the PDF on my iPhone it shows up blank. All I can see are the borders I created…
Cesar Bielich
  • 4,754
  • 9
  • 39
  • 81
18
votes
7 answers

How to calculate the height of a MultiCell/writeHTMLCell in TCPDF?

I try to create a PDF with multiple pages and need to calculate the height of each individual element (MultiCell) in advance to prepare for a page break. According to the documentation there are a couple of functions out there like…
merkuro
  • 6,161
  • 2
  • 27
  • 29
17
votes
1 answer

Linespacing in TCPDF MultiCell

I haven't found a way to control linespacing in TCPDF's MultiCell as of version 5.9. Nor have I found any method that helps to mimic the same behaviour by using Cell, such as some method that returns the portion of the text that doesn't fit inside a…
Carles Andres
  • 1,761
  • 1
  • 15
  • 22
17
votes
3 answers

Attach footer at very bottom to every page in tcpdf

I need to attach footer at the very bottom of every page. I am using tcpdf for generating pdf's. i tried many solution on google but did not found any luck. My current framework is yii and i am using tcpdf extension.
Muhammad Shoaib
  • 745
  • 5
  • 23
16
votes
3 answers

TCPDF: How can I place an image into an HTML block?

I've been working with TCPDF for a few months now; off and on. It's worked fairly well for most of my HTML templates, but I've always had problems placing images into the PDF's. The images are usually placed into the body, not the header. My…
jjwdesign
  • 3,272
  • 8
  • 41
  • 66
16
votes
1 answer

Creating multiple pages of PDF using android.graphics.pdf

I am trying to create an PDF using android.graphics.pdf. My issue is with multiple pages. I can give android.graphics.pdf html which could be then printed to a PDF. Now that doesn't work if text overflows the set page size. Is it possible to give it…
neelabh
  • 479
  • 6
  • 19
16
votes
7 answers

TCPDF, "Could not include font definition file" with OpenType fonts

I am a web programmer with no in-depth knowledge of fonts and am struggling to get TCPDF to include our custom OpenType font. We have bought OpenType font files (.oft), which are not protected by any kind of DRM. A lot of questions regarding this…
Seroczynski
  • 472
  • 1
  • 4
  • 14
16
votes
2 answers

How to use external css in tcpdf pdf generation

I am trying to create a pdf of a web page with tcpdf. But it's not working. The page is a php with external css and javascript files. Can anyone help me with this. Thanks,
user1559230
  • 2,790
  • 5
  • 26
  • 32
16
votes
6 answers

Creating a new PDF by Merging PDF documents using TCPDF

How can I create a new document using other PDFs that I'm generating? I have methods to create some documents, and I want to merge them all in a big PDF, how can I do that with TCPDF? I do not want to use other libs.
LuRsT
  • 3,973
  • 9
  • 39
  • 51
15
votes
4 answers

Why is TCPDF Image smaller than it should be?

I have a 842 x 595 PDF, 72 dpi and i'm inserting a 1200x800 image, again with 72dpi. scaleFactor is 1, imageScale is 1 in theory, my pdf should show part of the image (the first 842px). In reality the ratio is wrong, i have white space to the…
Bobby Tables
  • 866
  • 1
  • 9
  • 18
15
votes
12 answers

TCPDF HTML with Special Characters displays empty PDF file

I am using TCPDF Library Version: 5.9.011. I am trying to execute HTML layout as PDF. For which I tried with example provide with the site $html = '

HTML Example

List

Some special characters: < € € € & è è…
Asif Mulla
  • 1,652
  • 2
  • 22
  • 32
15
votes
1 answer

Why TCPDF instead of mpdf

I have used both TCPDF and MPDF !! Just want to know what features of TCPDF make it superior and one have to choose it over MPDF even thought MPDF is much easier to implement than TCPDF ? Anyone can please explain ? Thanks
CodeWithCoffee
  • 1,896
  • 2
  • 14
  • 36