Questions tagged [fpdi]

A PHP class which allows to read pages from existing PDF and generate new files based on FPDF.

Home page of FPDI

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

327 questions
0
votes
0 answers

FPDI: $pdf->Image($img, ..... No picture

I'm trying to paste an image onto a pdf. $img is a php generated PNG file. The image appears when echoed. echo ""; sleep(5); // initiate FPDI $pdf = new FPDI(); $pdf->setPrintHeader(false); // add a page // set the…
cj123456
  • 1
  • 1
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

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

Fatal error: Class 'setasign\Fpdi\FpdfTpl' not found in C:\xampp\htdocs\pdf\fpdi2\src\Fpdi.php

i am currently using this code for the data.php but I get this error Fatal error: Class 'setasign\Fpdi\FpdfTpl' not found and it says the problem originates in C:\xampp\htdocs\pdf\fpdi2\src\Fpdi.php` on line 24. I kept adding the…
Gregar GB
  • 13
  • 1
  • 4
0
votes
1 answer

incorporating FPDI in to an exisiting TCPDF scipt to append exisitng pdf to the created pdf

I have this code using TCPDF to create pdf invoices and it is working well. I now need to add the contents of another pdf to the last page(S). I have found server example of this using FPDI but cannot work out how this would be incorporated within…
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

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

PHP - Check if pdf contains given text - TcpdfFpdi / pdftk / fpdi

I have a pdf document and I want to check if a specific text occurs (which are tags that I put in while generating the pdf) in the document, however using these libraries (tcpdfFpdi, pdftk or fdpi) I couldn't figure out if it's possible or how to do…
senty
  • 12,385
  • 28
  • 130
  • 260
0
votes
1 answer

fpdi: How to concatenate with background

I'm trying to find an example of setasign/fpdi code. I have a pdf document with multiple pages. I want to create a new pdf that imports each page AND adds a background (this background is another pdf doc - portrait or landscape depending on root pdf…
John Wings
  • 11
  • 3
0
votes
1 answer

Splitted pdf files are as large as the original pdf

I have a 150Mb pdf (55 pages, containing text and images) generated with FPDF. I would like to split this PDF into single pages PDF. I use FPDI, but I have a major issue, each single page PDF is 150Mb (juste like the original pdf). Here is my code…
saperlipopette
  • 1,603
  • 12
  • 26
0
votes
1 answer

FPDI use template issue

Has anyone had any experience with fpdi in creating templates to be used on multiple pages. $fpdi->useTemplate($tplidx, 0, 0, 210, 297,true); The above works great for my template but when using writeHTML and the text goes over one page it only…
Ian
  • 745
  • 2
  • 10
  • 20
0
votes
1 answer

FPDF FPDI How to import a page from different FPDF class?

I have a class that creates a FPDF document. And I would like to include that document in a different FPDF class. // Document/Class 1 $pdf->new MyFirstDocument(); $pdf->output // Document/Class 2 class MySecondDocument extends…
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

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