A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearConverting HTML to PDF using PHP? [duplicate] - page 1
User InfoPosts
Converting HTML to PDF using PHP? [duplicate]#1
Possible Duplicate:
Convert HTML + CSS to PDF with PHP?

Is it possible to convert a HTML page to PDF using PHP, and if so, how can it be done?

Specifically, the page is an invoice generated dynamically. So I would like it loaded using:


And the HTML output would have to be converted to PDF.

Any good libraries that do this will be fine.

posted date: 2009-04-08 23:41:00

Re: Converting HTML to PDF using PHP? [duplicate]#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-08 23:41:01

Re: Converting HTML to PDF using PHP? [duplicate]#3
Yes, absolutely.There are off-the shelf solutions that you can purchase that(ll accept an HTML input and convert eh file for you.There is also a common PDFLib that you can use to generate your PDF(s using PHP but it requires you to create them manually by setting all the elements on the page.This is another one I(ve used that(s been pretty nice

posted date: 2009-04-08 23:46:00

Re: Converting HTML to PDF using PHP? [duplicate]#4
I personally don(t trust all those services that are offered for free. Here is an application you can download: http://www.tufat.com/script19.htm

posted date: 2009-04-08 23:49:00

Re: Converting HTML to PDF using PHP? [duplicate]#5
dompdf: https://github.com/dompdf/dompdftakes a html input string and returns the pdf-string.it(s not browser-level quality and has problems with css, but it works well enough for simple text documents.

posted date: 2009-04-09 00:06:00

Re: Converting HTML to PDF using PHP? [duplicate]#6
If your meaning is to create a pdf from php, pdflib will help you (as some other suggested).Else, if you want to convert an HTML page in pdf via PHP, you(ll find a little trouble outta here.. 3 years im triyng to do it as best as i can.So, the options i know are:DOMPDF : php class that wrap the html and build the pdf. Works good, customizable (if you know php), based on pdflib, if i remember right it takes even some CSS. Bad news: slow when the html is big or many complex.HTML2PS: same of DOMPDF, but this one convert first in .ps (ghostscript), then, in whatever format you need (pdf, jpg, png). For me is little better then dompdf, but have the same speed problem.. oh, better compatibility with css.Those two are php classes, but if you can install some software on the server, and access it throught passthru() or system(), give a look to these too:wkhtmltopdf: based on webkit (safari(s wrapper), is really fast and powerfull.. seem like is the best one (atm) for convert on the fly html pages to pdf, taking only 2 seconds for a 3 pages xHTML document with CSS2. Is a recent project, anyway, the google.code page is often updated.htmldoc : this one is a tank, it really never stop/crash.. the project seem death in the 2007, but anyway if you dont need css compatibility this can be nice for ya.

posted date: 2009-04-09 00:31:00

Re: Converting HTML to PDF using PHP? [duplicate]#7
Daniel, which one is the best for CSS then? WkHTMLToPdf?

posted date: 2009-04-09 00:37:00

Re: Converting HTML to PDF using PHP? [duplicate]#8
Yes, actually. we are triyn to use firefox too (with a command line addon by torisugary), becose, you know, nothing will take css better then a browser. wkhtmltopdf run on safari, so actually is the best, imho. I hope that mozilla will do something like it with gecko soon

posted date: 2009-04-09 00:44:00

Re: Converting HTML to PDF using PHP? [duplicate]#9
Dan, can you call wkhtml through php? It seems like it needs to be called using shell manually

posted date: 2009-04-09 00:49:00

Re: Converting HTML to PDF using PHP? [duplicate]#10
Sure, passthru() should work. something like passthru('wkhtmltopdf_version.sh yourhtmlpage.html yourpdf.pdf' $return); would work well if php and apache permissions settings allow that. Tried on a windows machine, works good.

posted date: 2009-04-09 01:10:00

Re: Converting HTML to PDF using PHP? [duplicate]#11
what about TCPDF?has lots of features, and one of advantage using it you can convert html to pdf on the fly

posted date: 2009-04-09 02:37:00

Re: Converting HTML to PDF using PHP? [duplicate]#12
Also this one that does a goog job : html2pdf

posted date: 2009-04-09 04:04:00

select page: « 1 2 »
Copyright ©2008-2017 www.momige.com, all rights reserved.