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
0
votes
1 answer

FPDF error: Some data has already been output, can't send PDF file (output started at C:\xampp\htdocs\movie\form.php:15)

I want to create a PDF from a form, but im stuck. It says "Some data has already been output" and I know it's the $name. But any idea how I can solve this problem?
user9554749
  • 53
  • 1
  • 5
0
votes
0 answers

How can you display a dynamically generated PDF created with FPDF/FPDI using AJAX on form submit

I am creating a page where a user can customize a PDF, after generating the PDF I want to display a preview of the generated PDF and allow the user to download or print it. I have the PHP working correctly for generating the PDF and now I am moving…
user13286
  • 3,027
  • 9
  • 45
  • 100
0
votes
0 answers

How do I center text horizontally within an FPDF generated PDF file

I am using FPDI/FPDF to dynamically add text to a PDF file. I would like for the text to be centered horizontally on the PDF regardless of how long the text is, but I am not sure how to set this using $pdf->SetXY Here is what I have so…
user13286
  • 3,027
  • 9
  • 45
  • 100
0
votes
1 answer

PDF file isn't downloading

I want to download a pdf file with result, I have already generate the pdf using fpdf [$pdf->Output($output_file, 'F');], the pdf file generated is saved in server. I want user to be able to download the pdf file generated from fpdf anyway. I even…
Mht
  • 3
  • 3
0
votes
0 answers

Forcing a PDF to Open in Browser Rather Than Downloading using FPDF Class of PHP

I have tried this, still unable to get the preview of it in browser. But the file is downloaded automatically which is not desired. $pdf->Output('I','EstimateReport.pdf');
0
votes
1 answer

Using FPDF and FPDI together

Im generating a PDF using FPDF which works fine, when certain conditions are met i want to be able to import an existing PDF (sometimes with multiple pages), what im finding though is the FPDI import is overwriting any existing FPDF page…
0
votes
1 answer

Labels created with PHP FPDF Library slide down page

I have created an FPDF PDF document that puts an image on label paper which has 9 rows of labels (PHP code below) There is no space/gap between each row of labels, and the next row of labels start immediately after the previous row. ### THE ISSUE:…
Ea2018
  • 1
  • 1
0
votes
0 answers

FPDF cannot display japanese word

Now I'm doing a task about exporting data into PDF from CodeIgniter framework. I'm using FPDF http://www.fpdf.org/ for exporting the PDF. And here is my controller: public function exportPDF() { $pdf = new FPDF('l','mm','A4'); // create new…
tjandra
  • 85
  • 1
  • 2
  • 7
0
votes
1 answer

FPDF can't create image

I select an image from a database table and save it in a variable: (Connection already established) require('fpdf.php'); $sql = "SELECT * FROM users WHERE ID=1"; $result = $dbConnection->query($sql); $row = $result->fetch_assoc(); $id =…
user10507326
0
votes
2 answers

Outputting text fields into PDF file using FPDF

On the first page(page1.php) which is an HTML form,content such as this is present: Form action is set as this:
I would like to create a pdf…
Igor Novoselov
  • 71
  • 3
  • 5
  • 10
0
votes
2 answers

PHP add a logo to existing PDF that stored in database (MySQL)

I am doing a basic system that the staff uploads a pdf file with some description and this data stored in database MySQL. The admin will view this pdf and click on approval if everything is ok. An image will be inserted in pdf file with approve…
Mahdi
  • 1
  • 1
0
votes
0 answers

Nigerian currency is not showing in fpdf

I want to show the Nigerian currency in my pdf using fpdf. But it not showing.Thanks in advance for any help.$custom_currency = '₦'; $pdf->Cell(60,20," $custom_currency.'-'.$g_total",1 , 1, 'L', 1);
Rafiq
  • 86
  • 1
  • 8
0
votes
2 answers

PHP - Create a PDF Trimbox

I'm using FPDF to create PDF files. But I need the file to have trimbox settings. How to do that. The trimbox needs to be 210mm x 297mm and the file has cropmarks of 7mm so the actual size of the file is bigger... 214mm x 311mm I found PDFLib but…
Remco K.
  • 644
  • 4
  • 19
0
votes
0 answers

FPDI: importPage() ruins FPDF document - and useTemplate() does not show the pages

I'm new to FPDI, until now I just used FPDF to create my PDFs in PHP. Now I wanted to attach some other documents to one of my FPDF reports. So I have the report (with a lot of FPDF cells with texts and some images) and want to add new pages at the…
acb1980
  • 145
  • 3
  • 15
0
votes
0 answers

Override third-party/helper/library functions in codeigniter controller

I don't know its easy or hard but I am not getting. How to override the core functions of the third-party libraries I have searched lot but not get even single idea about this. Scenario: I have added the FPDF library to 'application/third-party'…
Mahantesh
  • 347
  • 5
  • 20