Generating pdf newsletters automatically from WordPress: how to include a few pages and resolve memory limit errors

We’re using WordPress as a CMS for a client who was thinking of producing a newsletter, both for those without access and to promote the site itself. Rather than going through the rigmarole (and time & cost) of desktop publishing we set about finding a clever way to do this automatically.

Martin Hawksey at JISC RSC Scotland North & East has done a very good job of this with his Make PDF Newspaper plugin. It uses the fivefilters pdf newspaper facility which itself centres on the Simple Pie RSS management toolkit. There aren’t too many options available but if you’re prepared to accept limitations in layout, the tool is a remarkably easy way to generate a good looking pdf version of an RSS feed.

We’ve been working a little with the plugin to get the output we want. The structure of the site we have pdf newspaper running on is fairly straightforward – posts appear as departmental news items and a bunch of static pages serve guidelines and a simple document repository.

We wanted a few of these static pages appearing in the newsletter which presented a conundrum as WordPress RSS feeds only deliver the posts side of the CMS, leaving the pages out completely. However, the RSS Includes Pages plugin alters this behaviour. It’s perfect for our purposes. All we need to do is to temporarily invoke it whilst preparing the newspaper. To get the right pages appearing, all we have to do is alter the publication dates so they fit into just the right place in the RSS feed.

One problem I encountered is a memory limit when making pdfs more than a few pages long. To resolve this, add a line like:

ini_set("memory_limit","120M");

to the beginning of tcpdf_config.php in the pdf newspaper plugin package.

This entry was posted in Open Source, Web Development, Wordpress and tagged , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Welcome to Propheris Limited

    We are communications technology and marketing experts focused on the health sector.

    Our deep knowledge of digital and traditional channels enables us to craft your interfaces, information and messages efficiently and effectively, whether for use within your organisation or out to your customers and external stakeholders.

    We engage people with video, with websites and with database interfaces. And wherever appropriate, we link them all together to make the sum work more effectively than the parts.