Questions tagged [fpdf]

A PHP class which allows developers to generate PDF files with pure PHP instead of the PDFlib library.

Home page of FPDF

FPDF is a PHP class which allows developers to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

FPDF has other advantages: high level functions. Here is a list of its main features:

  • Choice of measure unit, page format and margins
  • Page header and footer management
  • Automatic page break
  • Automatic line break and text justification
  • Image support (JPEG, PNG and GIF)
  • Colors
  • Links
  • TrueType, Type1 and encoding support
  • Page compression

FPDF requires no extension (except zlib to activate compression and GD for GIF support). It works with PHP 4 and PHP 5

2301 questions
17
votes
4 answers

Line height in fpdf multicell

I am using fpdf multicell to display an address. Each line in the address will be displayed in a new line like : 102 South Avenue Suite 107 Scottsdale AZ 85260 111-000-1111 But the line height between…
janenz00
  • 3,315
  • 5
  • 28
  • 37
17
votes
4 answers

php send e-mail with PDF attachment

I am creating pdf using FPDF . Pdf is generating perfectly and also pdf is available with email. But i want to send body message also. I have tried with body message. Example Fine text message This is text message from shohag But only pdf attachment…
Monirul Islam
  • 985
  • 1
  • 8
  • 23
17
votes
7 answers

fpdf multicell issue

how we display fpdf multicell in equal heights having different amount of content
gireesh
  • 171
  • 1
  • 1
  • 4
16
votes
4 answers

Problems with FPDF and Euro symbol

I've spent a couple of days sifting through various methods to encourage FPDF to render the Euro symbol, but none have succeeded. I have: $currency = iconv("UTF-8", "ISO-8859-1//TRANSLIT", '€'); Which results in: iconv() [function.iconv]: Detected…
Wayne Smallman
  • 1,690
  • 11
  • 34
  • 56
15
votes
6 answers

FPDF - Inline bold text

I am trying to create a PDF from PHP and for legal reason we need to make part of our disclaimer BOLD and the disclaimer needs to be outlined. My current code uses: if(isset($_POST['optout']) && $_POST['optout'] == "yes"){ $pdf->Ln(5); …
I wrestled a bear once.
  • 22,983
  • 19
  • 69
  • 116
15
votes
3 answers

PDF Form filling with FPDF and then Flatten with PDFTK displays un-filled PDF

I'm using the "Form Filling" script from fpdf.org to fill some fields on a PDF Form I created. This appears to work properly. I want the resulting PDF form to be flattened so users can not edit the form fields. I'm using PDFTK for that. However,…
user1855093
  • 373
  • 1
  • 2
  • 14
14
votes
3 answers

How do I add a new font to a fpdf?

How can I add the Gotham-book font to fpdf. Most explanations are unclear and very difficult to understand. I need an example. Please can someone assist?
Janinekey
  • 431
  • 1
  • 4
  • 8
13
votes
7 answers

Is there a way to make FPDF/FPDI or Zend_Pdf support the parsing of PDFs greater than 1.4?

I am trying to add an existing PDF (created otherwise) to a PDF created with FPDF using FPDI. It seems to work find for most PDFs, but I get the following error: FPDF error: Unable to find xref table. After some testing, I figured out that if I use…
Darryl Hein
  • 142,451
  • 95
  • 218
  • 261
13
votes
1 answer

PDFMerger with FPDI-PDF-PARSER

FPDI PDF Files merger is being used. However, I ran into the following issue while trying to merge PDF files versions 1.5 and higher. The following was the error I received: This document (doc.pdf) probably uses a compression technique which is …
hello_its_me
  • 743
  • 2
  • 19
  • 52
13
votes
2 answers

Can FPDF/FPDI use a PDF in landscape format as a template?

I am trying to import an existing PDF as a template with FPDI. The template is in landscape format. If I import the template into a new document the template page is inserted in portrait form with the content rotated 90 degrees. If my new…
Jim OHalloran
  • 5,859
  • 2
  • 37
  • 57
13
votes
2 answers

FPDF Get page numbers at footer on Every A4 size page

I am creating PDF reports using FPDF. Now how do I generate page numbers on each page of a report at the bottom of the page. Below is the sample code for generating a 2 page PDF.
Jay
  • 477
  • 3
  • 7
  • 20
13
votes
8 answers

Wrap Text in Fpdf in Php

I am trying to Wrap a text in the Cell using FPDF. here is my code.
Jay
  • 477
  • 3
  • 7
  • 20
13
votes
8 answers

print BASE64 coded image into a FPDF document

I've some as base64 stored images in a database. Is it possible to print those data directly in a PDF document, using FPDF? Data sctructure of the…
Thomas1703
  • 1,152
  • 5
  • 16
  • 33
13
votes
3 answers

How to maintain image quality with FPDF and PHP?

I'm using FPDF with PHP to add an image to a PDF. But the image quality in the PDF is much worse than the original image, as you can see here: Relevant code: $image_height = 40; $image_width = 40; $pdf = new FPDF(); $pdf->AddPage(); $start_x =…
chejnik
  • 219
  • 1
  • 6
  • 24
12
votes
4 answers

How do I get the width and height of a doc generated with FPDF

How can I get height and width of a document in FPDF. For example, I've next line: $this->Cell(200,5,'ATHLETIC DE COLOMBIA S.A.',1,1,'C',1); But, I want to do something like: // $x = width of page $this->Cell($x,5,'ATHLETIC DE COLOMBIA…
chenio
  • 592
  • 3
  • 11
  • 27