<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechTrouts.com &#187; Uncategorized</title>
	<atom:link href="http://techtrouts.com/topics/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://techtrouts.com</link>
	<description>Doin' the dev dance o/</description>
	<lastBuildDate>Thu, 23 Jul 2009 10:42:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>php &#8211; Choosing the best HTML to PDF Converter</title>
		<link>http://techtrouts.com/php-choosing-the-best-html-to-pdf-converter/</link>
		<comments>http://techtrouts.com/php-choosing-the-best-html-to-pdf-converter/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 10:42:09 +0000</pubDate>
		<dc:creator>Carlos Ouro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://techtrouts.com/?p=69</guid>
		<description><![CDATA[Hello, As you should know multiple data export formats are an absolute requirement to web applications these days. Recently i got through working on a proposal creation and management application with theme support. So i couldn&#8217;t bare to use a simple customized pdf export system using FPDF or something alike &#8211; i needed a really [...]]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>As you should know multiple data export formats are an absolute requirement to web applications these days.</p>
<p>Recently i got through working on a proposal creation and management application with theme support.<br />
So i couldn&#8217;t bare to use a simple customized pdf export system using <a title="FPDF Library - PDF Generator" href="http://www.fpdf.org/" target="_blank">FPDF</a> or something alike &#8211; i needed a really good HTML to PDF converter.<br />
Well, i&#8217;ve spent a couple of days looking for the best answer to this question.</p>
<p>I&#8217;ve tested 4 different HTML to PDF classes/libraries out there, and read about a few more throughout the web.</p>
<p><a title="Dompdf" href="http://code.google.com/p/dompdf/" target="_blank">Dompdf</a>, which i had used before on previous projects was my first choice, the code is kind of nicely done and well organized into classes. I <a title="does not work when an __autoload function already exists - please use standard class file names" href="http://code.google.com/p/dompdf/issues/detail?id=15" target="_blank">had to edit the filenames</a> but it ended up playing well with <a title="Open-source php library system" href="http://naturephp.org" target="_blank">NaturePhp</a>. It worked more or less in the beginning but after de first application release some strange rendering and memory problems. The application would just die if i the user added some custom texts sometimes (without any errors displayed&#8230;) and text alignment and tables didn&#8217;t work very well&#8230;</p>
<p>So i went back to looking for another solution &#8211; the first i tested was <a title="TCPDF" href="http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf" target="_blank">TCPDF</a> &#8211; it worked actually much better than dompdf, but the lack of much CSS support didn&#8217;t work for my purposes &#8211; still it looked like really stable and had some nice extra features.<br />
I´ve also tried <a title="html2fpdf" href="http://sourceforge.net/projects/html2fpdf/" target="_blank">html2fpdf</a> but it didn&#8217;t really work as i expected.</p>
<p>After much looking around i finally found <a title="html2pdf /ps php converter" href="http://www.tufat.com/s_html2ps_html2pdf.htm" target="_blank">html2ps</a>. The site looks a bit old and ugly but i had already read some nice quotes about it somewhere so i decided to take a look.<br />
Meaningless to say html2ps &#8216;saved&#8217; my weekend &#8211; it works really good. Well it&#8217;s not perfect, but as long as keep your html more or less simple and well formed, it renders nearly perfection.<br />
Stable, reliable and so far the best option i&#8217;ve tested for HTML to PDF conversion for php.</p>
<p>However, the API code and online documentation could be better &#8211; it took me a while to integrate it into NaturePhp and get it to work. It really is much simpler if you use it via a simple HTTP request (with options via querystring) as the &#8216;demo&#8217; folder shows.</p>
<p>I know it is not easy &#8211; I myself am struggling to get some decent NaturePhp documentation out &#8211; but such a nicely working project should really be given a nicer look to the site/docs and possibly some major code review.</p>
<p>Visit them at <a title="Tufat.com - php html2ps" href="http://www.tufat.com/script19.htm" target="_blank">tufat.com</a> or <a title="Freashmeat - php html2ps" href="http://freshmeat.net/projects/html2ps_php/" target="_blank">freashmeat</a></p>
<p>Still, from now on, it will be my PDF converter of choice, unless something better comes around&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://techtrouts.com/php-choosing-the-best-html-to-pdf-converter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
