Working PDF support!
One of the most-frequently asked questions on my journal is how I have PDF support working “so seamlessly.”
I use a plug-in called WP2PDF.
Unfortunately, WP2PDF, often misbehaves and is non-trivial to install and configure. The following tutorial details some of the things I have done–including changes to its code–to make it work.
Now you can have PDF support for your web log too!
“Now you can have PDF support for your web log too!”
Why would anyone want that? Offering a PDF version of a blog entry seems pointless when all you’ve got to do is fix your stylesheet to exclude those elements (forms, links, etc) which are useless on paper.
I don’t doubt the effort you’ve made to get it to work, it just seems like a feature not worth spending time on.
It was not my intent to belittle you. I’m sure you’re learnt some valuable things from the exercise, just put it down to (valuable) experience.
I would suggest you eperiment with a “print” stylesheet. Perhaps this article might be a good starting point.
If you implement it nicely, your users have to do nothing apart from simply print the page.
Actually the request comes up from time to time in wp.com land.
Creating a print stylesheet is extremely easy to do if you use Firefox with the Web Developer extension. Just load your page, hit CTRL-SHIFT-E to edit the CSS. This will let you edit the CSS and see the changes in real time. Then edit it until it looks like something worth printing and copy your stylesheet into print.css as described in the article above. Neat, huh?
PDF support is nifty, but if all it’s doing is generating a printable version of the post, then it seems like overkill to me. Still cool, nevertheless. Works better with images, I’m sure.
pizdin_dim: No offence taken. I just feel like an idiot for not realising I could just tweak the CSS. I came at it from the perspective of “fetching a post (or posts) in a convenient form to read later.”
I used to feature really long posts on my journal, and it seemed like a cool idea at the time.
As drmike pointed out, I only posted the instructions because people keep asking me how I got it to work.
What pushed me over the top was a couple of these people offered me money to instruct them (perhaps they really value their time, or something), and I decided to free information I believed ought to be free.
Otto42: Thanks for the tip Otto, I will try it out soon.
I’m slightly old-school in that I type my pages/stylesheets out in Emacs, refreshing my browser from time to time.
Oh, no, I use vi for text editing. You can’t out old-school me! 🙂
But the functionality in that extension makes it *really* easy to see changes and to find what the information about the DIVs you want to eliminate are. It’s well worth the trouble.
So we know where our allegiances lie, I am not a fan of vi.
(There, I said it!)
Will try your pluguin – I actually think is it useful plugin, esp as some people may want to save a post as a pdf file.
In your instructions on http://emphaticallystatic.org/taming-pdf-support/ it says edit wp-includes/template-functions-links.php though this file does not exist for WP2.13? Is there another file to edit?
(Glad you caught that. I have been “upgrading” WordPress since even before it was WordPress. My file structure is most messed up.)
I just downloaded a fresh copy of 2.2 to check it out. Try adding the WP2PDF code to
I figured that out eventually.
Though getting errors on WP2.13 – seems to be conflicting with some plugins on my home test site? For example,
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wp213\wp-includes\link-template.php:526) in C:\xampp\htdocs\wp213\wp-content\plugins\dd-formmailer\dd-formmailer.php on line 18
Also, for http://localhost/wp213/wp2pdf/wp2pdf.php
Warning: fopen(../pdf/actualitydotlog-20070527-115521.pdf) [function.fopen]: failed to open stream: No such file or directory in C:\xampp\htdocs\wp213\wp2pdf\fpdf.php on line 1300 FPDF error: Unable to create output file: ../pdf/actualitydotlog-20070527-115521.pdf
- I am unsure what the problem with this formmailer plug-in is, but you could try disabling it while testing the pdf plug-in. Sort out problems with running them both together after first getting them to work individually.
- Try to create a folder
wp2pdffolder, and make sure it is writable.
- The topic ‘Working PDF support!’ is closed to new replies.