Best way to create a PDF with PHP


Question

I've been reading up on creating a PDF file with PHP and am wondering what the easiest option is.

  1. Create a PDF template, open it and replace placeholder text -- which function do I use to open an existing PDF for editing?

  2. Create a PDF template and place text on it using co-ordinates

  3. Create a HTML document then convert it to PDF using some sort of free tool?

  4. Create a PDF from scratch using PHP (this seams like a time consuming way to do it).

1
175
1/29/2016 8:12:08 AM

Accepted Answer

The one that i know of as being best is the FPDF. It is great open-source solution for creating all sorts of PDF layouts. Thanks

See FPDF tutorials
And scripts

110
1/25/2010 12:03:35 PM

If you want very advanced features in PDF creation then try TCPDF. If you want just minimal features of PDF creation and want a smaller in size class then try FPDF.

The following link has an article describing these two PDF generating class libraries: Easily create PDF with PHP


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon