Software:
News ToolsReg Shops |
Build your PDF and Excel reports with PHPOffice 2.0 without the fluffPublished Monday 10th December 2007 19:43 GMT Hands on The Portable Document Format (PDF) and Microsoft's Excel spreadsheet are commonly used for presentation of reports and data. PHP, meanwhile, has become one of the most commonly used scripting languages on the web today, with 35 per cent of web sites running PHP. The TIOBE index of programming languages also indicates an increase in the usage of PHP. Given the prevelance of PHP, Excel and PDF it's fortunate there exists class libraries for the generation of PDF documents and Excel spreadsheets using PHP. In my latest guide to PHP, I shall look at generating an Excel spreadsheet using the PHP Extension and Application Repository (PEAR) module, Installing ClibPDFFirst, install PHP 5 and Apache2 HTTP Server and configure the Apache server with PHP. We won't discuss configuring Apache server with PHP as it was discussed in an earlier article on PHP, Accessing DB2 UDB with PHP. The extension=php_cpdf.dll Restart the Apache HTTP server. Creating a PDF Document with ClibPDFCreate a PHP file $cpdf=cpdf_open(0); Set the title of the document. cpdf_set_title($cpdf, "Catalog PDF"); Start a new page using cpdf_page_init($cpdf, 1, 0, 595, 842); Add a bookmark for the current page. Specify the text of the bookmark in the text parameter. cpdf_add_outline($cpdf, 0, 0, 0, 1, "Page 1"); Next, add title text of the PDF document. Start a text section with cpdf_set_font($cpdf, "Courier-Bold", 25, "WinAnsiEncoding"); Set the coordinates of the text with cpdf_set_text_pos($cpdf,4.70,7.5);
Track this type of story as a custom Atom/RSS feed or by email.
|
|
||||||||
Top 20 stories • All The Week’s Headlines • Archive • Search