user1411837
user1411837

Reputation: 1564

PHP PDF conversion

I am using PHP 5.0 pdf library to convert files dynamically into PDF. I am using this reference from the official PHP website using PDF_new(), creating its object and using PDF_set_info and PDF_get_buffer functions.

This works fine, but when I want to create PDF pages and writing the content inside of it, there is no reference given anywhere on how to convert an already existing page to PDF. Say a page in my folder bill.php with CSS too needs to be converted to PDF on the fly.

Upvotes: 1

Views: 395

Answers (3)

Xylum
Xylum

Reputation: 28

html2PDF is a nice library to use. Make sure you change the default language to English though. I've used it many times to create dynamic invoices with tables and divs. Works really well.

Upvotes: 1

AB Bolim
AB Bolim

Reputation: 2125

Refer some of the articles, which may help to improve your knowledge as well as clear some of doubt of you.

  1. Getting started

  2. Convert HTML To PDF in PHP The Easy Way

  3. How to Generate a PDF With PHP

  4. Convert HTML to PDF

  5. This HTML to PDF SDK may also help you.

Hope, it will help you.

Upvotes: 0

Chris
Chris

Reputation: 518

Well converting HTML to PDF is not that easy, there are several libraries out there that might fit your needs. But none has full html/css capabilities, especially not css3.

FPDF http://www.fpdf.org

TCPDF http://www.tcpdf.org

DOMPDF http://code.google.com/p/dompdf/ (this class allows you to easily convert simple layouted websites to pdf. i used this class quite often with almost no problems. sadly this library does not support converting of forms to usable input fields.)

WKHTMLTOPDF http://code.google.com/p/wkhtmltopdf/ (actually a linux package but php wrappers are existing. this gives almost full html capabilities and awesome results)

Upvotes: 1

Related Questions