skip to content

 Web design 

Database-driven systems

Easy-to-maintain web sites


 



Login

Forgot Details?,
PDF Output - TCPDF

I did some research on PDF output tools looking for something simple that would allow me to write html output (from PHP) and have it converted to a PDF.  I eventually decided to use HTML2PDF but this is another alternative. A link to the site is provided below. The things I like about it:

  • It's open source.
     
  • It has built-in html conversion.
     
  • It requires virtually no setup and no external modules.
     
  • It's pretty simple to use and works reasonably well.
     

Writing text output with html formatting works well. Writing out HTML tables is a bit tricky and will probably require a customized module tuned specifically to what TCPDF will accept. It isn't nearly as forgiving as writing html to a browser. It seems to need closing </td> and </tr> commands. Column sizing seems to work according to TCPDF's default width unless you specify a width on every column. A background color for a row is only applied to the first cell. It doesn't seem to allow font (face/family) changes. I don't think that it supports .css files.

Despite these limitations, it's a good free PDF program (but not quite as good overall as HTML2PDF). It has lots of capabilities that I didn't spend any time on but may be of value to others. It comes with a whole series of demo modules. 

You can find it at:

http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf

 

 

 

 
   

Powered by Website Baker,
Design by Innovations Design based on a template by gavjof