February

13

WordPress PDF Plugin Tools

Recently I’ve been looking into the PDF tools available for WordPress. The task seemed simple, make it possible to PDF any page on a site in a wysiwyg fashion. The PDFing function should be representative of the live content on the site, so if a post or page is edited, the PDF generated will show the latest content. The user shouldn’t have to do any additional work. Well of course there are two issues here:

  1. You don’t always want wysiwyg for print media, often a stripped down version that will fit onto one page of A4 and in grayscale is better for print.
  2. Ensuring that formatting is correctly carried across is actually a pit trickier that expected as print media is based around pt sizing and web best practice suggests that em is a better solution

In either case to make life easier, you need to be creating a specialised stylesheet for print. Stephanie Sullivan has wriiten a good starter guide for Adobe and another really useful tip from Jason F is to bunch what isn’t needed for a style sheet into a block at the head of a page.

What really would be  whole lot easier though is to use one of the several different WordPress Plugins that have been created to assist in PDFing web content. Many of these will do the creation of a print friendly document, some even allowing you to customise which page elements are and aren’t printed out. Here’s my take on the current crop:

AS PDF

Generates PDF documents from posts, putting a link to a PDF document in automatically underneath each post. Configuration options allow changing:

  • Link text
  • Font size in PDF document
  • Whether PDF opens in browser window or as a forced download.

There’s also the option to use an included style sheet, which toggles on and off a PDF document icon next to the link text for the PDF.

Blog as PDF

This plug in export posts from your wordpress blog as a PDF. This is all done from the dashboard settings for the plugin, but does allow the selection of some categories or downloading all posts in the site. Doesn’t handle pages. Due to the nature of this PDF plugin, it’s not something that will benefit your readers – well not unless you are intending to download the necessary PDFs and keep your site up to date by maintaining the latest version in your media library with links to them from your entries.

pdf24 post to pdf

Gives readers the option to convert one or more articles into pdf files. This is done by placing a box at one of sevral configurable locations, where the user needs to enter their e-mail address. A pdf file is then generated and sent. This setup allows for pdfing just a specific article or all articles on the page.

The plugin can be configured in the dashboard setting to control the email content properties, page format and layout, and the location of the email address box that is shown on the site. The functionaliyty of this plugin is good – there is a lot of scope to customise what’s produced, but the thing is you have to be happy with an emailed version of the PDF and the pop-up window that comes with it as confirmation.

I also had issue with the fact that if you insert the code into a template so you get a sidebar or the top/bottom box displayed, you should get a PDF containing all articles on a page, thing is when I tried that I only received 4 posts in the PDF rather than the actual number shown on the page (over 20).

Print What You Like

Print What You Like is a very nifty website that allows for the full customisation of what is seen on web pages ands where.  This plug-in s basically an interface for WordPress. You set up an account on the website and then eneter generated code to get the plug in working. It’s also possible to generate different codes and save them on your profile so that different pages can be customised to appear differently when printed.

This plug-in looks like it has huge potential to develop into a great product, but at the tiem of writing, I could not get the PDF generator to fucntion consistently well. Like the PDF24 plugin, this uses an external service hosted on another server to produce the PDF and return the result. I could get the website to produce a PDF the way I wanted it styled, but actually getting it as a PDF was a near impossible task as the server would time out and stall most of the time.

mpdf

This plug-in allows you to print WordPress posts and pages as PDF. It also offers optional with Geshi highlighting should you want to include it. This is a nice plug-in in the sense that it does the PDF generation on the server your WP installation is hosted on. There are a few little issues, like when you install the code, the icon that appears on the posts doesn’t do anything when you click it, you have to right click and choose save as.

In the backend dashboard, there is the option to make all pages which have the code applied to their templates available for PDF download, or you can setup a whitelist or a black list to differentiate between what can be saved as a PDF for anyone, or specifically logged in users.

Although it is based on it, this last plugin perhaps should not be confused with Ian Back’s mPDF which is a PHP based solution for generating PDFs. It’s what I’m now investigating for my own requirements. The reason I’m not choosing any of the above?

Well the thing is that many of them are fine if you have a basic blog which is largely posts and a few pages. Once you start getting clever with WP and start using it to display multiple excerpts of posts by category and in some cases repeating it twice on one page and having a sidebar with other posts in that too, well it all gets a bit too complicated and too much for anything other than Print What You Like and that unfortunately just doesn’t seem stable enough right now.

Update
Well it turns out that the mpdf plug-in was based on the mpdf application that Ian Back had produced. I played around with both but couldn’t get either to work satisfactorily. Then I found out about DomPDF, which Alex King has discussed previously. It’s a nice application with some good documentation and has been rolled into a WordPress Plug in too. It’s what I’ve decided to go for…

Conutto PDF Plugin

Versatile and lightweight plugin that uses DomPDF as the basis for generating PDFS of pages and posts.

Written by Cris Bloomfield,
posted February 13th, 2010

RSS Feed

No comments yet.

Leave a comment