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
2 answers

header and footer line in FPDI/TCPDF

I'm stamping my PDF documents with FPDI and TCPDF functions, and I'm trying to figure it out, how can I add a line below the text in Header, and upon the text in footer. Here is my…
Zbyněk Dufka
  • 37
  • 1
  • 7
0
votes
1 answer

Using Chinese fonts in TCPDF and FPDI. Encoding problems

I am writing a script that generates Chinese character worksheets (so students can generate and practice writing) The script is passed a 15 character string from a form in index.php. The string is then exploded into an array of 15 elements (each a…
Wojtek Grabczak
  • 131
  • 1
  • 1
  • 6
0
votes
0 answers

FPDI function called from FPDF

This script loops over some JPG files and adds them to a PDF. After each JPG, I need to insert a PDF file, and as far as I can tell that can only be done with FPDI. $GLOBALS['txt'] = 'Cover Text'; $GLOBALS['mid_x'] = 11/2; $imagesFiles =…
Dan
  • 527
  • 1
  • 7
  • 25
0
votes
1 answer

Merge PDF's with FPDI and TCPDF in PHP

I know there are LOTS of threads on this on SO and I have tried everyone of them, and not been able to make one of them work. In SO thread: Creating a new PDF by Merging PDF documents using TCPDF this snippet by @Sygmoral sounds as if it should work…
Dan
  • 527
  • 1
  • 7
  • 25
0
votes
1 answer

Loop through a directory and add write a number in the pdf file

I need to add a increasing number to all of the pdf files in directory. I can loop through all the files. I can write a number in one file , but when the loop starts for the next file I get an error: Cannot redeclare class PDF #!/usr/bin/env…
0
votes
1 answer

PDFMerger v1.0 fails using FPDF 1.6 and FPDI 1.3.1 with SSLv3 disabled

Disabling SSLv3 on our web server caused this error: FDPF error: Unable to find pointer to xref table We're using the PDFMerger class which also user FPDF 1.6 and FPDI 1.3.1 and the only way it works is when SSLv3 is enabled. Our temporary…
chrsc
  • 11
  • 5
0
votes
0 answers

FPDI character limitations

I am using FPDI to add names to a PDF. However I came across a issue, it will only allow me to add a maximum of 16 characters. Anything more and it will not display the name on the PDF. How can I resolve this? I wasn’t able to find anything with…
EzGoing
  • 23
  • 5
0
votes
1 answer

Class Object inside Function Not Working (FPDF)

I'm using FPDF (plus FPDI). I have a code like this: $pdf->setSourceFile("source.pdf"); $tplIdx = $pdf->importPage(1); $size = $pdf->useTemplate($tplIdx, 1, 1, 5.4); Result: Works fine. But when I wrap the code inside a function: function…
Fomo
  • 143
  • 9
0
votes
1 answer

How to direct the generated PDF to download instead of preview?

I am successfully generating a PDF by using fpdf and fpdi libraries. The problem is that *$pdf->Output(); line opens the pdf for preview whereas I have been asked to let it download by default. Though I can change my own browsers' settings to force…
0
votes
2 answers

TCPDF / FPDI / FPDF Image size is wrong

I am creating dynamic pdf files with tcpdf,fpdi,fpdf .The template pdf file is done in indesign and i wanted to use the x and y coordinates as a guide. (In design settings are in px). but when i put a picture $pdf->Image($pic1, 10, 10, 100, 100, …
0
votes
2 answers

Experiencing weird top margin when using fpdf Write()

I'm trying to write text to a PDF and there seems to be a weird margin on the top of my page. This is my following code: require_once('fpdf.php'); require_once('fpdi/fpdi.php'); //Start the FPDI $pdf = new FPDI('P', 'pt'); //Set the source PDF…
bryan
  • 8,879
  • 18
  • 83
  • 166
0
votes
2 answers

FPDI : Call to undefined method FPDI::_getrawstream() on Drupal

I try to use the FPDI lib with Drupal to concatenate pdf together. I created a class to add a new pdf to fpdi : class PdfGenerator { public function importPDF(&$fpdi, $file) { $pageCount = $fpdi->setSourceFile($file); for ($p = 1; $p…
tyhupo
  • 29
  • 1
  • 5
0
votes
1 answer

Fpdf edited files not displaying in browsers?

i have added some text using fpdf library.The added text is displayed in adobe reader ,but when i open those files using my browser the text is not visible. I can only see those text using my adobe reader program. $fullPathToFile =…
Kavita
  • 225
  • 1
  • 3
  • 12
0
votes
1 answer

FPDI Fatal error: Uncaught exception 'Exception' with message 'Unable to find object (1, 0)

I'm trying to import a pdf with php class FPDI with this simple code: require_once("fpdf/fpdf.php"); require_once("fpdi/fpdi.php"); $pdf = new FPDI(); $pdf->setSourceFile('intermedia.pdf'); $tplidx =…
essegi
  • 1
  • 1
  • 1
0
votes
0 answers

Pdf.js: print rendering in Safari & Chrome

I am generating a PDF using TCPDF and feeding the resulting base64 stream to pdf.js for printing. The display output appears as expected, but when I preview or print the document, some unexpected scaling takes place. In TCPDF, I am importing an…