php to pdf
- Started
- Last post
- 11 Responses
- sinisnap
i dunno if anyone has done this, but what i need to do is have a "print this page" type button on a php page that will convert the html generated by the php script to a pdf for download..
the solutions on the web that i have found really complicated things that either involve money or tedious settings, or ones that work only with flat html, not something that converts an open window that has been generated by a php script..
just wondered if anyone had done this and how!?
thanks
- Xentic0
I'd be interested to know too! Would be very nice!
- REDWOOD0
I've made one time an pdf from an XML document but not from a php script but maybe you can convert it into an xml document.
- unfittoprint0
if u have pdfLib in your server, it's fairly easy to accomplish that. Just create the PDF with variables you would use to echo the html file.
- sinisnap0
hey unfittoprint, thanks, i did look into that and fpdf but couldnt really understand how either could take a page like this:
http://www.refreshedmedia.com/fl…
and instantly convert it to a pdf using a button like the one in the top right corner..
sorry, im probably being totally dumb
- sinisnap0
damn sorry..
- unfittoprint0
ok.
copy you php file, your going to format this new one to output to pdf.In your file u'll have a variable that creates the Vehicle Type, Model, Mileage, Min, Term and Price.
Instead of inserting them within HTML tags, you should use pdf_set_info to insert your content:
Check example 1 on this page:
http://www.php.net/pdfsome more useful info
http://www.phpbuilder.com/column…
http://bettina-attack.de/jonny/p…
http://www.potentialtech.com/ppl…
http://www.axisdata.com/AxisPHP/…
http://www.interakt.ro/products/…
http://www.interakt.ro/products/…you probably prefer an application that converts HTML 2 PDF:
http://www.easysw.com/htmldoc/
[usage with php] http://www.easysw.com/htmldoc/ht…
- sinisnap0
oh man you rule..
i will have a look through all of that..hopefully my brain won't melt
- PuFFi0
this is what you are looking for, the scripting is strange but amazing.
- instantok0
it would be nice if someone made a converter that supported css (for free) this (http://html2fpdf.sourceforge.ne... is the closest i've found but seems to be a work in progress and a little buggy
- mirola0
i've been using http://www.ros.co.nz/pdf/ to do a similar thing recently. works nicely but a bit limited.
- sinisnap0
yeah, instantok, that's what we need, come on generous php genius!
took a look at that html2pdf link..looks potentially promising..