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 mc table with image

I have trouble displaying image (or this time is photo) using mc table FPDF. This is a little of my script: $pdf=new PDF_MC_Table(); $pdf->SetWidths(array(30,10,30,230)); $pdf->SetAligns(array('L','L','L','C')); $pdf->Row(array($name, $age, $gender,…
Hendri P
  • 31
  • 5
0
votes
1 answer

Serbian characters in FPDF

I have problem with Serbian language in FPDF http://www.fpdf.org/ $mystring = "Запослени у рачуноводству/сродном радном месту"; I used $pdf->Write and MultiCell... all are same result. utf8_decode($mystring) -> ????????? ? ?????????????/???????…
ca michel
  • 105
  • 2
  • 8
0
votes
1 answer

How to use PHP libraries whithout composer (FPDI with FPDI protection)

I use FPDI without composer so my file looks like this: ... use \setasign\Fpdi; require_once($_SERVER['DOCUMENT_ROOT'].'/fpdf/fpdf.php'); require_once($_SERVER['DOCUMENT_ROOT'].'/fpdi2/src/autoload.php'); // initiate FPDI $pdf = new…
Rocstar
  • 1,427
  • 3
  • 23
  • 41
0
votes
0 answers

MPDF Error: Unable to find object (4, 0) at expected location

I have some PHP pages and PDF that I need to merge into a single PDF file. I am using the MPDF library but I am getting the following error: "Unable to find object (4, 0) at expected location." This is my code:
Yaco Zaragoza
  • 429
  • 1
  • 7
  • 18
0
votes
1 answer

SetDrawColor() is behaving like SetFillColor()

SetDrawColor() supposed to color Cell frame but instead another color is rendering as background color. This is the whole code :- $pdf = new FPDF(); $pdf->SetTextColor(103, 58, 183); $pdf->SetDrawColor(0, 80, 180); // Fourth Page…
santanu bera
  • 1,281
  • 10
  • 16
0
votes
1 answer

Digital sign a PDF with PHP / Symfony / TCPDF

I'm trying to sign a pdf throw the example from "https://tcpdf.org/examples/example_052/" My certificate file extension is ".p12" instead of ".crt". So I changed the 77 line that makes reference to the certificate. $certificate =…
0
votes
1 answer

Insert Charts/Graphs using FPDF

I apologies in advance if this question/query seems trivial. Despite my efforts searching within this forum and others, I still could not find a clear solution of how graphs or charts are included using FPDF. What I am trying to achieve is to create…
R.Cremona
  • 59
  • 1
  • 7
0
votes
1 answer

Using easyTable with FPDI in PHP

I'm trying to generate PDF using FPDF - easyTable and FPDI (beacuse I need to use template of pdf file) and it's not working. I get an error: Fatal error: Class 'setasign\Fpdi\FpdfTpl' not found in C:\xampp\htdocs\TestFPDI\fpdi\src\Fpdi.php…
akei9
  • 45
  • 1
  • 3
  • 12
0
votes
2 answers

I can see the array outside function, but no inside the function, how pass variable inside function?

Sorry for english, not my native language. I am trying to pass an array into a function. This array contains the three months of a determinate trimester. This code is about FPDF, I am doing a PDF report. This is the code:…
Ivan J.
  • 87
  • 1
  • 1
  • 8
0
votes
1 answer

Add pasword on PDF using FPD on Download

The output of my fpdf is download. an I want to automatically add a password on it before you can view the pdf. $pdf->Output('C:\Users\User1\Desktop\filename.pdf','D');
Dumbest666
  • 47
  • 3
  • 13
0
votes
1 answer

How do I use Extended ASCII characters in a PHP/PDF document generated by FPDF?

I am trying to create a document that contains Extended ASCII characters. For text coming from the client the following works: // Convert from UTF-8 to ISO-8859-1 - Deal with Spanish characters setlocale(LC_ALL, 'en_US.UTF-8'); foreach ($_POST as…
JSWilson
  • 1,113
  • 1
  • 11
  • 28
0
votes
0 answers

How do I use the FPDF Library in Angular 5.0

I am using Angular 5.0 and the FPDF Library (www.fpdf.org) for creating PDF documents in PHP code. I have used this library in JavaScript with no problems, however with Angular, which the marketing people say is a superset of JavaScript, the PHP…
Brian Fleming
  • 63
  • 1
  • 6
0
votes
1 answer

Center table in my PDF document with FPDF

I am trying to position a table in the center of my PDF using FPDF, searching the internet I did not find any solution. The table you make is the one explained in the examples on the official page. (Modified to load data using a database, but the…
0
votes
0 answers

FPDF print properly currency symbol given by NumberFormatter class

I'm adding a price value, retrived from a db, inside a cell on a pdf created with FPDF, using this function: $fmt = numfmt_create( 'it_IT', NumberFormatter::CURRENCY ); numfmt_format_currency($fmt, $row['prezzo'], "EUR") Considering that the EUR…
Antoder
  • 65
  • 2
  • 9
0
votes
1 answer

FPDF - failing to open eps file?

I am unable to use EPS file in FPDF (but here it is able to open EPS http://www.fpdf.org/en/script/script84.php ). What is wrong in my code? Error: Fatal error: Uncaught Exception: FPDF error: File was saved with wrong Illustrator version:…
user285594