Skip to content

Biting the hand that feeds IT

The Register ®

Software:


Related Whitepapers

Comments on ‘Build your PDF and Excel reports with PHP’

Office 2.0 without the fluff

Published Monday 10th December 2007 19:43 GMT

« Back to article page

If you can't use PECL 

By Si
Posted Monday 10th December 2007 22:09 GMT
Thumb Up

If you can't use PECL I highly recommend the FPDF class here: http://www.fpdf.org/

It's written entirely in PHP so you don't need to re-compile or install anything special to use it and it works on most versions of PHP from 4 onwards (it probably works with PHP3 but I've not tried it).

That;s only basic PDF 

By zac spitzer
Posted Monday 10th December 2007 23:29 GMT
Stop

But if you really want to work with PDF's you cannot beat Coldfusion 8 from Adobe. You can simply take Full blown HTML with CSS etc and create a PDF directly, plus there is deep support for doing all sorts of things with PDF.

It's not open source, but if you have anything beyond basic PDF text to do or you need great looking PDF's, the cost of a standard CF license will be easily recovered

Dont wanna steal your thunder... 

By Anonymous Coward
Posted Tuesday 11th December 2007 00:40 GMT
Coat

You could alway make it universally programtically available for excel by just making a plain html table and generate the file with a .xls extention... works perfectly!

:p

And the *nix version is ? 

By Uwe Dippel
Posted Tuesday 11th December 2007 01:41 GMT

or do you only entertain Windows boxen ?

html2pdf 

By Martin Beckett
Posted Tuesday 11th December 2007 02:08 GMT
IT Angle

Or create html (with css) and use html2pdf from php

LaTeX? 

By Taran Ablitt
Posted Tuesday 11th December 2007 03:19 GMT

LaTex is how I generate PDFs from PHP. Output the LaTex, process into PDF then serve up and depending on the case, cache for future access. Works very well for me.

ClibPDF Depreciated 

By Calum
Posted Tuesday 11th December 2007 05:42 GMT

Looks like ClibPDF is depreciated...

http://de3.php.net/manual/en/ref.cpdf.php

Uwe - if you mean the *nix version of this article then its identical, just different directory locations, as the scripting is all php based. however if you are talking bout the file formats then you may have a point but there is a pdf reader and open office for linux.

Apache POI with PHP-Java Bridge 

By Pie Man
Posted Tuesday 11th December 2007 08:48 GMT
Thumb Up

Excel_Spreadsheet_Writer is still fairly basic. If you need more functionality, try using Apache POI from PHP. It'a actually a Java Application, but it's methods can easily be accessed from PHP using either the free or Zend PHP-Java bridge. If anyone's interested in more information james2 /at/ jfirth /point/ net

Lets not forget pdftk 

By Not That Andrew
Posted Tuesday 11th December 2007 09:30 GMT
Linux

The swiss army death ray of pdf toolkits.

So last year... 

By George
Posted Tuesday 11th December 2007 09:42 GMT
Thumb Down

This is not the best article on ElReg.

The new way surely has to be Zend Framework for PDF writing. PEAR works, but ZF is superb and well structured.

http://framework.zend.com/

Another vote for ZF here. 

By Andrew Moore
Posted Tuesday 11th December 2007 09:55 GMT
Thumb Up

Type your comment here — plain text only, no HTML

How big? 

By Anonymous Coward
Posted Tuesday 11th December 2007 14:21 GMT
Stop

Excuse me but what size did you say A4 was?

re: How big 

By Martin Beckett
Posted Tuesday 11th December 2007 17:44 GMT
Coat

1.04 * 1.47 mFurlong

Been There, Done That 

By A J Stiles
Posted Wednesday 12th December 2007 11:49 GMT
Heart

I've already been generating PDF files out of Perl for some time now, just by generating PostScript (OK, so I know a bit of PostScript ..... wouldn't call myself anything like fluent, but I know how to draw simple shapes and stick text on a page) and piping it through pdf2ps. You can even insert images saved as EPS straight into the stream. It doesn't half look impressive (although that's probably more to do with the perception of PDF as being used only for highly "official" documents). As a final touch, I even detected the user's OS and offered a link to an appropriate, non-Adobe PDF reader (healthy competition is a wonderful thing).

Also, if you generate a simple CSV file but give it the extension XLS, Excel will load it without missing a beat (Office doesn't really go for file extensions). You can even provide a second link to download the same file with a CSV extension (for Open Source users), so as not to scare anyone into thinking they absolutely need proprietary software.

Try phpPDF 

By Shelon Padmore
Posted Friday 14th December 2007 18:31 GMT

Consider phpPDF. It's quite good

- Shelon Padmore

whitepaper title

Solution Brief: Reduce Energy Costs

Energy consumption has become a big issue. Dramatically increase server utilization and significantly reduce energy costs through Virtualization..
whitepaper title

Server Consolidation and Containment

This paper discusses how consolidation and containment solutions with a virtual infrastructure meet the challenges of server sprawl and underutilization..

Top 20 storiesAll The Week’s HeadlinesArchiveSearch