[geeklog-devel] PDF feature....

Tony Bibbs tony at tonybibbs.com
Mon Jun 7 17:09:17 EDT 2004

Ok, I've updated CVS for, hopefully, the last time. Here is a quick 
feature rundown of the PDF functionality:
1) PDF feature completely driven by config.php and is disabled by 
default since it requires installation of third party software.
2) Stories now have a pdf icon (similar to print and email icons) that 
will take the HTML Geeklog generates during the print mode and generates 
the PDF from it
3) Optionally, admins can enable an ad-hoc PDF generation feature that 
would allow users to enter any URL and generate a PDF.  This is disabled 
by default but
    is always excessible by Root users when the PDF feature is enabled.
4) Optional support of HTML tidy.  Again, this requires yet another 
third party tool to be installed so this is disabled by default
5) Font point size is configurable
6) TTL on generated PDF's is supported (i.e. you can tell Geeklog to 
delete PDF's more than one day old) NOTE: untested
7) Supports get & post parameters so integration with other GL plugins 
is easy.

This needs testing, particularly on windows. The original code I had was 
very unix-centric and I did my best to make it OS independent.  I 
haven't confirmed the TTL feature
is working yet (next on my to-do list) but the code is there and looks 
right ;-).  Also, thinking of forward compatibility, this feature uses 
the $_REQUEST PHP super global which means that a fairly recent version 
of PHP is required.  I plan to add some code soon to check the PHP 
version and manually build the $_REQUEST array if it isn't supported but 
I didn't get around to that yet.  Finally, I did some refactoring of the 
code I got but a lot more is needed. I had grand visions of making this 
100% OO but just didn't have the time. 

This code also deserves a look from the security perspective.  I'm 
thinking some sort of  speed limit would be a good start.  Anything else?

One last time, if you have a chance to test this a quick note on whether 
it worked or not and what your configuration is would sure be helpful.


Rob Griffiths wrote:

> On Jun 4, 2004, at 6:35 AM, Tony Bibbs wrote:
>> Yeah, the generator take a simple URL as an argument.  It then 
>> downloads the HTML for the URL and converts it to PDF.  That should 
>> make integration into GL's plugins a breeze.
> What's wrong with File -> Print -> Save as PDF ... oops, sometimes I 
> forget we're not all using OS X.  Couldn't resist :) :)
> Actually sounds quite cool, and I know some PC using friends who would 
> love such a feature for sites like Groklaw...
> cheers;
> -rob.

More information about the geeklog-devel mailing list