Download presentation
Presentation is loading. Please wait.
Published byJuniper Carson Modified over 9 years ago
1
A Unified Presentation By: Kelly Sponberg (kelly.sponberg@noaa.gov) By: Geoff Rowland (geoffrey.rowland@noaa.gov) Using Database Driven PDFLib to Automatically Create and Deliver Customized Reports of Disaggregated Web Content
2
Required Software PHP PHP MySQL (or your favorite database) MySQL (or your favorite database) PDFLib and PDI (commercial library for PHP -- ~$1000) PDFLib and PDI (commercial library for PHP -- ~$1000)
3
The Problem and Case Study Parnters at USAID OFDA wanted reports which covered a variety of topics, could be printed for meetings, contained content from a variety of NOAA and non-NOAA websites, and of course they wanted this information updated regularly. Parnters at USAID OFDA wanted reports which covered a variety of topics, could be printed for meetings, contained content from a variety of NOAA and non-NOAA websites, and of course they wanted this information updated regularly. We could create a web portal, but honestly extensive theme pages and lists only appeal to those who know exactly what information they want. Of course a portal does not help create a printable document. We could create a web portal, but honestly extensive theme pages and lists only appeal to those who know exactly what information they want. Of course a portal does not help create a printable document.
4
We could create the reports by hand, simply pasting information into a PowerPoint or other document, but that is a lot of work and requires significant operational capacity. We could create the reports by hand, simply pasting information into a PowerPoint or other document, but that is a lot of work and requires significant operational capacity. Additionally, this information would likely be shared with field offices that may or may not have PPT or the ability to download large files. Additionally, this information would likely be shared with field offices that may or may not have PPT or the ability to download large files. The Problem and Case Study
5
Our First Thoughts We could create a HTML document which is laid out to be truly print compatible, and is driven by a database. We could create a HTML document which is laid out to be truly print compatible, and is driven by a database.BUT……………….. It seems like their would be too many exceptions depending upon browser, content type, maybe even printer. It seems like their would be too many exceptions depending upon browser, content type, maybe even printer. Still doesn’t help for distribution of a single document, or something which could be used on a LCD projector during a meeting. Still doesn’t help for distribution of a single document, or something which could be used on a LCD projector during a meeting.
6
PDF and PHP A PDF would be ideal. It’s a printable standard, nearly universal or at least viewable with a simple and free reader, and it would provide some of the same functions as a PowerPoint file in that users could digitally write on the document, use it in an overhead presentation, etc. Lucky for us someone made PDFLib. PDFLib is a PHP Library which can generate PDF documents of any length, while also dynamically bringing in text and images. Surprisingly, PDFLib is about as easy to use as any other image creation or graphing library used with PHP. Another extension, PDI, allows you to use PHP to “glue” existing PDFs together.
7
Online Demonstration
8
Example of PDFLib Functions PDF_begin_page($p, 595, 842); $image = PDF_open_image_file($p, "jpeg", $imagefile1, "", 0); if (!$image) { die("Couldn't open image ".$imagefile1); die("Couldn't open image ".$imagefile1);} PDF_place_image($p, $image, $use_lefmarg, $new_floor, $img_scale); PDF_close_image($p, $image); PDF_setcolor($p, "both", "rgb", 0, 0, 0, 1); PDF_set_text_pos ($p, 80, "$sdescript_ceiling"); PDF_show ($p, "$row[short_descript]"); PDF_end_page($p);
9
Basic System Components User “Accounts” Created Documents (User, Selected Pages, etc) Content (Web Locations and Meta Data) Account Managing PHP Page Creation PHP Content Download and Update (PHP Download, CRON Triggered) Content Bin PDF
10
The Potential for Other Bulletins? Images, no problem – template already recreated Text, not a problem, but does require significant, upper level understanding of PHP to “strip” text content from a website – particularly if the content changes considerably in length.
11
Additional Information Climate Information Project http://www.cip.ogp.noaa.gov PDFLib http://www.pdflib.net PHP http://www.php.net MySQL http://www.mysql.org
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.