Barry Connolly
Barry Connolly

Reputation: 663

PHP PDF functions

How do I generate PDF files with PHP. php.net says that pdflib needs to be installed to use functions such as new_pdf ().

However, pdflib is not free and the lite version is not allowed for commercial use. I am confused. I would have thought PHP would have some built-in functionality to create PDF files.

How do I get through this as I do not want to use libraries such as fpdf, etc.?

Upvotes: 3

Views: 2391

Answers (3)

Ritesh Kumar Gupta
Ritesh Kumar Gupta

Reputation: 5191

PHP does not have any in-built functions, so you have to use libraries. TCPDF is the easiest modules and it's free.

Upvotes: 1

agough
agough

Reputation: 605

If you don't want to use pdflib, you will have to use another third-party library.

Zend provides one as part of the Zend Framework. But the ones we have used for various purposes are:

  • DomPDF is great for taking HTML and producing PDF files
  • tcPDF is a more class-based drawing style approach, but it works great and gives loads of control.

Upvotes: 1

dev.meghraj
dev.meghraj

Reputation: 9110

You should try the following. They are some useful PHP libraries for PDF documents:

See Stack Overflow questions Generate PDF from HTML PHP and How to generate PDF files with PHP?.

It's your choice with which you feel more comfortable.

Upvotes: 5

Related Questions