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

How to add watermark to PDF file with PHP and FPDI for Print only?

I am using FPDF and FPDI to add current date to the existing PDF file $pdf->Cell(0,15, date("Y/m/d"), 0, 0,'R' ); Is it possible to make it visible only when document is printed, something like Set Visibility Print Only? (Sorry if duplicate, I'm new…
Andy Blinde
  • 27
  • 1
  • 5
0
votes
1 answer

Php pdf split to pages

I have pdf files. Need import them to system and split by pages. Seperate page = separate file. I tried use FPDF and FPDI: $pdf = new FPDI(); //FPDI extends TCPDF $pdf->AddPage(); $pages = $pdf->setSourceFile($sLeadDirPath . $sImageName); …
0
votes
1 answer

PHP Fpdi error "unexpected T_USE, expecting T_FUNCTION"

I'm trying to merge two pdf with fpdi and fpdf but I got an error, and I didn't found anything about that. I took the basic code from https://www.setasign.com/products/fpdi/demos/concatenate-fake/ I'm also using CodeIgniter. There is my code : use…
user11383471
0
votes
1 answer

Why FPDF's useImportedPage doesn't work for PHP code

I receive the following error when using useImportedPage() for generating labels... ErrorException [ Fatal Error ]: Call to undefined method FPDI::useImportedPage(). But when I comment out $pdf->useImportedPage($tplIdx, 10, 10, 100); and…
user1839477
  • 45
  • 1
  • 8
0
votes
0 answers

Want to create a composite pdf document from other documents and then add dynamic forms

I'm creating an incoming invoice processing tool for my accounts department. Basically i want to take the incoming invoice (a pdf of unknown size and shape) and insert it into my template pdf. So basically I end up with a document (that is always…
0
votes
2 answers

Is it possible to efficiently split a PDF into individual pages (using FPDI)?

I am trying to split large files into individual pages, using PHP's FPDI library. For some reason, splitting the file does not do much to reduce the file size. For example, the following script applied to a 30 page 1MB file results in 30 files of…
IanS
  • 1,459
  • 1
  • 18
  • 23
0
votes
3 answers

Can't require_once fdpf/fpdf.php

I am using the FPDI library from JanSlabon for securing PDF file uploads from my laravel app. But I can't execute the code require_once even though I navigated to the file itself. I am getting the error: Failed opening required…
zernzern1993
  • 235
  • 8
  • 19
0
votes
1 answer

Getting 'Cannot open pdf' error with a correct source url when using FPDI

I'm trying to edit a pdf in laravel. I've created the following function in my controller, which has use FPDI and use FPDF static function getHigherPDF() { $pdf = new FPDI(); $pdf->AddPage(); $pdf->setSourceFile('/pdf/higher.pdf'); …
movac
  • 1,576
  • 3
  • 21
  • 45
0
votes
1 answer

TCPDF & FPDI: use PDF template for subsequent pages

We want to create dynamically generated PDFs via HTML - but we also want to use an existing template for each generated page. Using a template via FPDI is straight forward enough: // Generate the FPDI instance $pdf = new…
fritzmg
  • 2,494
  • 3
  • 21
  • 51
0
votes
1 answer

TCPDF each() is deprecated function under PHP 7.3

You may have an error back using TDPDF, error saying each() function is deprecated, error in fpdi.php line 562
Patriboom
  • 41
  • 5
0
votes
1 answer

mPDF use FPDI v2

I am currently using mPDF to handle a couple of things. The problem I'm facing however is that mPDF uses a version of FPDI that is unable to handle files over PDF version 1.4. There is a (paid) commercial addon that makes handling newer PDF files…
0
votes
0 answers

Hide download and print option in pdf(mpdf or fpdi) in codeigniter

I don't want to show download and print option in pdf, Is there any way to hide the navbar or toolbar in pdf using pdf libraries(mpdf or fpdi) in codeigniter?
Pavan BS
  • 11
  • 4
0
votes
1 answer

Class 'FpdfTpl' not found but required / included

So I am very confused.. The paths for the requires below are correct. Been working in Java on Android and haven't been in PHP for awhile but I have done a lot in PHP and never had this issue. Autoload should be loading everything according to the…
0
votes
1 answer

Question relates to "Parse error: syntax error, unexpected 'class' (T_CLASS) in FpdiTrait.php"

I see by all the threads that this issue has arisen many times in differing environments and in different forms. Most answers I have seen suggest changing the PHP version. Here's my puzzler. My client has a website that is running on PHP5.6. I…
0
votes
0 answers

How to add text into an existing PDF using PHP?

I need to add a small text so that it is in the footer of my PDF file. I am trying following code: require_once('pdf/fpdf/fpdf.php'); require_once('pdf/fpdi/Fpdi.php'); $fullPathToFile = "../assets/files/".$arquivo; $pdf = new…
sNniffer
  • 210
  • 2
  • 19