WordPress PDF Plugin Reviews
PDF Plugins for WordPress
Recently, one of my clients who is on a WordPress platform requested that I provide them with the functionality to render some of their web pages to Adobe PDF format. At first thought I thought this was not a big deal and I should simply be able to complete this task using a WordPress plugin. As I was trying out some of the PDF Plugins on one of my sites for testing I decided to compile a review of what I experienced while working with these particular WordPress plugins!
Print Friendly and PDF Button
This Plugin actually worked and does generate print friendly and PDF versions of pages and posts inside of the WordPress environment. When I clicked the button on a page containing a HTML table I was excited to see the clean PDF it generated. Here are the downsides and why I can’t use it for my client or any of my corporate service websites: 1) The WordPress Plugin is tagged with the authors information which I don’t believe can be easily removed and I find it tacky to have this info on a corporate website as it takes away from the branding and appeal. 2) It would appear that I can’t control which particular pages and/or posts I have the ‘Print Friendly’ button on in order to generate the PDF files or print friendly versions of the pages and/or posts. 3) While the PDF is being generated the Plugin displays a number of ad links which I think is really tacky and I simply can’t accept that as I know my clients will not like that at all. So I move on to explore more PDF Plugins for WordPress!
WP Post to PDF
Next up is the ‘WP Post to PDF’ WordPress Plugin… we may have a winner here. On my test site this plugin did exactly what I was looking for in a matter of seconds. With one slight adjustment of the settings I was able to include only the pages that I wanted the functionality on by supplying a comma delimited list of the page ids. The page simple displays an Adobe icon below the title which generates a PDF in a separate window when the icon is clicked with the mouse cursor. Simple, quick and easy.
Ouch… Perhaps I spoke too soon. Although when I installed it on one of my WordPress sites this PDF Plugin worked fine for me. Now on my client’s site I experience the following errors:
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/www/mydomainname.com/wpfolder/wp-content/plugins/wp-post-to-pdf/wp-post-to-pdf.php on line 45
The Plugin is currently working on my site that is running WordPress 3.0.5 and PHP version 5.2.16. The Plugin is not working on the site which is running PHP version 4.4.9 and WordPress 3.0.2. I upgraded the WordPress 3.0.2 site which was running PHP version 4.4.9 to PHP version 5.2.13 and the WP Post to PDF Plugin seemed to do what it was supposed to do at first glance. However, as I went through the many pages that I wanted to generate to pdf I noticed that some were produced with just a header and no content from the WordPress page. It would seem that all of the pages that were not generating to pdf included pages with HTML Tables and pages with HTML Tables and images although some of the pages that were generating to PDF correctly, that is not produce a blank PDF file, included images and some pages included HTML Tables. So at this point I can’t find any rhyme or reason to why this plugin works correctly on some pages while it produces a blank pdf on other pages.
After playing around with the Plugin on the two aforementioned WordPress installations I started with a fresh, new install of the latest version of WordPress, version 3.1. To no avail, I experienced the same issue: the PDF contained content on some pages while producing a blank PDF on other pages. Stumped.
At the time of writing I have sent a message to the WordPress “WP Post to PDF” Plugin author Neeerav Dobaria ofwww.vareen.co.cc concerning the issues I am having and to see if he has any offers to suggest. I will keep you posted. In the meantime, I will attempt to use yet another WordPress PDF Plugin!
PDF24 Articles To PDF
With over 20,000 downloads from WordPress.org and coming in with a fairly better than modest rating of 3 and a half starts on the WordPress.org Plugin rating system I decided to give PDF24 Articles To PDF version 3.0.7 a shot on my freshly installed WordPress 3.1 test site.
It did not take me long to install the Plugin, change a few settings and click a link on one of my WordPress pages that did nothing but generate a blank HTML popup window above my page. Next!
Article2pdf boasted over 19,000 downloads and a rating of 4 and a quarter stars so this had to be working for someone out there. With that in mind I decided to download it and give it a try.
When I activated the Article2pdf Plugin inside my admin control panel I received the following error:
“The Plugin generated 188 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this Plugin.”
Although I received the above error I continued to work with the Article2pdf WordPress Plugin to discover the following:
If you want to display the PDF you have to place the following in your single.php or post.php file:
If you use non standard permalinks (e.g. “/%postname%”), add the link html code <a href=”/?article2pdf=1″>PDF Version</a> to your theme. I put the html code into the “single.php” and the “page.php” of my theme and it works fine for me.<br/> Example link: http://my-blog.org/my-category/my-post/?article2pdf=1
If you use the standard permalink structure (?p=123), add the following link to your theme: <a href=”/<?php the_permalink(); ?>&article2pdf=1″>PDF Version</a><br/> Example link: http://my-blog.org/?p=123&article2pdf=1
Now, the issue with the above approach is that this would produce a “PDF Version” link on each of my pages and/or posts in my WordPress blog and the ability to generate a PDF of page or post content is something I just want to limit to certain particular content.
Another approach I could take is hard coding the links in the pages only that I want to create PDF’s from… I would do so by adding the following line to my page or post links:
Which would be at the end of my page id as so:
So my link that I would use with a button on a particular page would be:
This would work great for me, however, I don’t think some of my clients and end users would want to have to create a link or a button with the above code example. Other areas of concern are that it is just creating the PDF in black and white and is not recognizing my background color in multiple table cells in the HTML tables that are in the WordPress content. Also, the center horizontal alignment is not present in the generated PDF for my table cells. I have yet to try this Plugin on pages or posts with images to see how those convert. That will be my next step with this plugin, let’s find out how it renders images and that may be able to compensate for some of the setbacks I have experienced with Article2PDF WordPress Plugin thus far.
So I quickly copied and pasted come source from one of my live WordPress blogs into my test blog and gave Article2pdf a test and nothing… my images did not appear in the generated PDF file just white, blank empty space where my images should be looking back at me L.
I wondered, perhaps, maybe there is a possibility that the fact that I was using absolute paths to images outside of the domain that I was working from could be causing issues. So I quickly copied some images and uploaded them to my test site. I changed my absolute image links to relative paths to the freshly copied image directly and gave it another try… boo… nothing… once again no images and the formatting is horrible on this particular PDF. I guess it is time to move on and try something else. I thought I may be able to salvage a solution out of the Article2PDF Plugin but in this case I guess I am wrong and so I am moving on.
I quickly found out that this WordPress PDF Plugin does “work” but has its limitations. First off, out of the box it looks like all pages and post will have a link to generate a PDF and the text of the link is one of the few variables you can change with this Plugin. Second, the link to generate a PDF is at the bottom of all pages and posts with no options in the admin control panel to change where the link appears nor on what pages and posts the link appears on. Again, it is on all pages and posts by default, out of the box, with no immediate options to change.
Moving past those issues I found out that the AS-PDF WordPress Plugin does not handle HTML Tables well at all when creating the PDF. Anything using HTML Tables is going to be skewed or distorted to say the least. However, if you were just going to be generating plain text or text and images (those did work with this Plugin) then this may be the route to go if you can get over the link on every page and the link on the bottom of the page, although I am sure there is a work around I am just too appalled at how the HTML Tables came across from my test site that I cannot consider using this Plugin for my current project. Also by default with no visible option to change, the PDF is generated in the same browser window that the link is clicked, something that would have to be changed in the source code? So again I move on to other WordPress PDF Plugins.
Now I find myself downloading the “wp-mpdf” WordPress Plugin. Another Plugin, another attempt. After installing this Plugin, making a quick change to my page.php file for my WordPress Theme, then quickly making some changes to the Plugin via the admin control panel I was there! This is the WordPress Plugin that does exactly what I need. It renders HTML Tables, Table cell formatting, Images and text to PDF no problem and everything looks really really nice. After installing the Plugin you will simple need to add this code to your page.php and/or single.php files in order to use it:
<?php if(function_exists(‘mpdf_pdfbutton’)) mpdf_pdfbutton(“true”); ?>
The first parameter we pass the function is “true” which makes the PDF open in a new window.
Then through the admin control panel you can adjust settings in with the Plugin and with your WordPress pages and/or posts to allow which pages/posts in your site can be generated in PDF format.
You may also wish to change the following logo for the PDF icon:
More details concerning this WordPress Plugin can be found in the WordPress Plugins section of this site under: wp-mpdf
So there it is is… after experimenting with six different WordPress Plugins I finally find the Plugin which will meet my needs and be my “go to” Plugin as far as PDF generation is concerned. Thanks for reading and I do hope this helps some others out there and saves them the trouble of having to go through trial and error to find the right WordPress Plugin for their situation.