Contribute  :  Support  :  Downloads  :  Forum  :  Links  :  Polls  :  Calendar  :  Directory  :  Advanced Search  
Geeklog The Ultimate Weblog System
Welcome to Geeklog
Friday, May 16 2008 @ 12:10 AM EDT
   

New PDF features in 1.3 CVS Tree

GeeklogOk, 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.

Story Options

New PDF features in 1.3 CVS Tree | 10 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
New PDF features in 1.3 CVS Tree
Authored by: krove on Tuesday, June 08 2004 @ 04:16 AM EDT
Very cool.

I'd like to see the Printable link use CSS to transform the page into a
printable version (media="print"), as opposed to the creation of a new
printable.html page. With Axonz creating almost pure CSS themes, this
should be a possibility and an option in future versions of GeekLog (not
just v2, either). Then the PDF feature could work off of the CSS version
of the page.

Good job, though! I'm impressed.
New PDF features in 1.3 CVS Tree
Authored by: Tony on Tuesday, June 08 2004 @ 09:47 AM EDT
Yeah, problem is there aren't any PDF generators out there that are GPL'd (or the like) that honor CSS transforms. At least that was true last I did some searching. If you find an alternative that does do this let me know.



---
The reason people blame things on previous generations is that there's only one other choice.
New PDF features in 1.3 CVS Tree
Authored by: geeklog-fan on Tuesday, June 08 2004 @ 08:47 PM EDT
where do I have to install htmldoc? in my home or in my html directory

I have downloaded the source code of htmldoc and put it in /home/sitename/htmldoc.. but that doesn't work

after that I tried to install it in /home/sitename/www/htmldoc... does not work either..

:(
New PDF features in 1.3 CVS Tree
Authored by: Tony on Wednesday, June 09 2004 @ 01:25 AM EDT
The htmldoc binary can go anywhere as long as you point $_CONF['path_to_htmldoc'] to the binary and as long as your webserver user can execute it.

---
The reason people blame things on previous generations is that there's only one other choice.
New PDF features in 1.3 CVS Tree
Authored by: geeklog-fan on Friday, June 11 2004 @ 02:12 AM EDT
what exactly is needed for the webserver to execute it? so I can inform my web host provider :)
New PDF features in 1.3 CVS Tree
Authored by: Tony on Friday, June 11 2004 @ 10:10 AM EDT
At a minimum the htmldoc binary and, optionally, HTML Tidy. I wouldn't be surprised if htmldoc is already installed or if your host would agree to install it. HTML Tidy, however, would require you to recompile PHP with the tidy PECL

---
The reason people blame things on previous generations is that there's only one other choice.
New PDF features in 1.3 CVS Tree
Authored by: geeklog-fan on Tuesday, June 15 2004 @ 01:44 AM EDT
hmm.. I get the following error:

The document provided was not rendered. The document was received but could not be processed. Please make sure to submit only html formatted documents that have been written to the xHTML standard. Please note that overly complex html documents may not render correctly or at all.The document resulting from your attempt was 0 bytes in length, and has been deleted. If you're sure that your document should render fine, please re-submit it.

what exactly does this mean and what should I do?
New PDF features in 1.3 CVS Tree
Authored by: Tony on Tuesday, June 15 2004 @ 11:10 AM EDT
Were you using the ad-hoc feature or generating a PDF from a Geeklog article. If ad-hoc, what URL were you using. I've had similar errors and I plan on investigating this more before a final release. There should be no issues with PDF'ing Geeklog articles.

---
The reason people blame things on previous generations is that there's only one other choice.
New PDF features in 1.3 CVS Tree
Authored by: geeklog-fan on Sunday, August 01 2004 @ 08:29 PM EDT
I didn't enable adhoc in config.php, but when I set it to 1, it gives me the same error.. I just clicked on the pdf icon next to the title of a story, but all I get is the error I mentioned above..
New PDF features in 1.3 CVS Tree
Authored by: geeklog-fan on Sunday, August 01 2004 @ 08:31 PM EDT
Oh.. I noticed that the pdfs folder in my home directory on my server is used, so the files are generated, but that's all