Discover the best of the web!
Learn more about Digg by taking the tour.
PDF Generation Using Only PHP
zend.com — Yes this is right no external libraries no complicated programming, a simple approach on generating PDF documents only using PHP.
- 1030 diggs
- digg it
- disgruntled, on 10/12/2007, -0/+0done this before but digg anyways so more people can see.
- geminitojanus, on 10/12/2007, -0/+0Ahh I thought about doing this once but came up with a simpler solution, but a solid digg for bravado.
- hotwaterham, on 10/12/2007, -0/+0Fun. Good stuff.
- isilex, on 10/12/2007, -6/+0I don't like it to force an upload after I select a file -- what if I select the wrong file by mistake.
Good work with using ajax -- but needs to be refined. - isilex, on 10/12/2007, -4/+0aaah!! wrong comment at the wrong digg story!! (ignore my prev comment)
- nocircleno, on 10/12/2007, -0/+2I just used this free php library for a project end of last year. You just need to upload it to your server and include the one file.
http://www.fpdf.org/
Worked good pretty, low learning curb. - kevin45, on 10/12/2007, -3/+0Been there, done that... coldfusion..
- ipugh, on 10/12/2007, -1/+1coldfusion is far superior to php.
LOL
[/sarcasm] - swizzcheez, on 10/12/2007, -1/+0For doing this (far better) in Python, use reportlab: http://www.reportlab.com/
- MannaPC, on 10/12/2007, -0/+0This is ooooooold.
- dognose, on 10/12/2007, -0/+0better yet, make the page in HTML (generated by any language) the convert to pdf using htmldoc
- erco, on 10/12/2007, -0/+1I recall originally starting out writing a web based invoicing system by using direct generation of PDF from code, but it gets difficult to debug when you scale up.
The easiest technique I've found to create PDFs from PHP/Perl/Python scripts is to pipe the desired PostScript equivalent into ps2pdf(1) [LINUX] or pstopdf(1) [Mac OSX] which is probably already in your path, and needs no install.
PostScript is a bit more 'user friendly' to read and debug, with error reporting a bit easier to manage. Also, one can easily debug and develop new code just by cut+pasting into a gs(1) prompt to do 'render tests'. - Farnsworth, on 10/12/2007, -0/+1Digg effect...crashed with only 130+ diggs?
- jnorris441, on 10/12/2007, -1/+0Welcome to 2 years ago??!!!
- paulcooper, on 10/12/2007, -0/+1should have linked to part one.
- Kam3k, on 10/12/2007, -0/+2Wouldn't it be easier just to use http://www.fpdf.org/ ? There's a ruby port of this also which works well.
- Farnsworth, on 10/12/2007, -0/+1N/M...just a sparatic MySQL error...
- gol706, on 10/12/2007, -0/+1I've had really good luck with this module free PHP PDF generator, it can even do images:
http://www.ros.co.nz/pdf/ - joeyjojo, on 10/12/2007, -2/+0The world needs less PDF files. Not more. ;o)
- altjeringa, on 10/12/2007, -0/+1now if we could just remove PHP from the equation everything would be good. ;)
good stuff. - kevin45, on 10/12/2007, -0/+1Whats wrong with CF? Everyone seems to pop a boner all of the sudden for PHP and AJAX.
- kewldude606, on 10/12/2007, -0/+0WTF is up with the comments? Way to many...
require 'PDF.php'; // Require the class. - SNACKeR, on 10/12/2007, -0/+0@dognose - if only HTMLDoc supported CSS...
- yonah, on 10/12/2007, -0/+1cool tutorial, but this capability in PHP is OLD.
- thotpoizn, on 10/12/2007, -0/+1I wonder... am I the only one who read the headline and asked themselves: who the #$@*# is the "PDF Generation"? ;)
- DrCrane, on 10/12/2007, -0/+1@kevin45
Cold Fusion is nasty, tag-based programming that comes with a hefty licensing fee--at least, last time I cared enough to look into it.
PHP is easy to use, has broad support, is free...I could keep going. And nobody has popped anything over PHP in a while.
Mentioning Ruby, particularly Rails, is the current way to turn a geek's pants into a tent. - kevin45, on 10/12/2007, -0/+0Well at work we use fusebox 4 with CF 7 and its fairly simple through micromanaging the way everything is accessed.
- gambl0r, on 10/12/2007, -0/+0ColdFusion is great.. and PDF creation is simple when using it.
And of course AJAX isn't tied exclusively to PHP or Ruby.
More CF diggs, less PHP :D - gullevek, on 10/12/2007, -0/+0looks nice, but I stick with my oldschool latex way. at least I can format the page as I want and I definitly get a good result.
- abbtech, on 10/12/2007, -2/+0Nice!
------------------------------------
http://hackedgadgets.com - sporty, on 10/12/2007, -1/+1"Yes this is right no external libraries no complicated programming, a simple approach on generating PDF documents only using PHP."
Yes there's an external library. It's called PDF. They supply it. Others have too in various languages. Not that this isn't news, but you're selling us something that's been done before.
Digg is coming to a city (and computer) near you! Check out all the details on our