Create PDF from current HTML page

Possible Duplicate:
Convert HTML + CSS to PDF with PHP?

I'm on a basic Apache with no extensions apart from default enabled and I want to create a PDF file from the current page.

The current page is PHP echoing out some variables but I want to create a PDF document from the HTML and text currently shown on the page.

Something like WHMCS quote system.


You could use a third party solution such as:

http://pdfcrowd.com/

http://www.web2pdfconvert.com/

http://html-pdf-converter.com/

I'd recommend pdfcrowd.com - it has an API that you can use and i've used the service before and not had any problems.


Take a look at FPDF .

It is a free libary for generating .pdf documents within php.


Look into FPDF, TCPDF, DomPDF, or any other PHP PDF library.

FPDF is very lightweight, and could be perfect for you if you are just echoing out variables.

TCPDF is much more HTML->PDF in terms of syles and css features, but the file size is a bit bigger. It could be used to easily build invoices and make them look nice.

I haven't used DomPDF personally, so I won't comment on it, but it can get the job done.

链接地址: http://www.djcxy.com/p/15574.html

上一篇: 使用Codeigniter将HTML + CSS转换为PDF

下一篇: 从当前HTML页面创建PDF