Generates a printable PDF newspaper from post content.
Generates a printable PDF newspaper from post content. Great for distributing your articles and posts in a print format for offline audiences.
To use, from the admin area of your site, select what content you want to include (supports posts, pages or custom post types and you can filter by tag or category), how many items, whether to truncate the body content (or excerpt) at a certain character length, how many columns to format with, and which fields to display. You can even upload a “masthead” header image for a more authentic newspaper feel, and the plugin can automatically generate QR codes to allow link scanning with a mobile phone camera.
Download the resulting PDF or save it to your media library for easy public linking and sharing.
This plugin does not require any remote PDF generation services or subscriptions to create the printable PDF file, everything is done within the plugin itself.
Credit to TCPDF for the PDF generation library and Freepik for the plugin icon.
Feature suggestions, bug reports and pull requests on GitHub are welcome.
Printable PDF Newspaper is most easily installed via the Plugins tab in your admin dashboard.
You can customize the PDF newspaper layout and styles using limited CSS definitions, in two different ways:
ppn_pdf_template_css_file_path
to specify the full filesystem path to a file containing CSS styles.When specifying custom styles, do not enclose them in a <style>
tag or any other HTML. Invalid CSS may break the PDF generation process.
Here are the CSS classes you may wish to adjust:
You can view the default style definitions in the plugin file assets/admin/css/pdf-template-styles.css
or in Trac.
Note that TCPDF only supports a limited subset of the full CSS specification. Also note that any fonts referenced must be available in the TCPDF library used to generate the PDF. You can view the TCPDF core font list.
There’s also an experimental filter, ppn_font_file_paths
, that allows you to add to or change the array of TTF font file paths being loaded.
Currently the header image size/position and subheading styles are not easily customizable, but will be in the future.
These filters are available to further customize the plugin functionality:
ppn_post_query_args
: override the array of arguments to WP_Query to control which posts are includedppn_pdf_configuration
: override the array of PDF configuration values specified by the admin userppn_pdf_template_css_file_path
: override the full filesystem path to a CSS file for PDF content stylingppn_font_file_paths
: override the array of filesystem paths to TTF font files to include in the PDFFor example, to customize the number of posts included in the PDF, add something like this to your theme:
add_filter( 'ppn_pdf_configuration', function( $config ) { $config['number'] = 2; return $config; }, 10, 1 );
Some people still encounter things and ideas through engagement with objects in the physical world. If you are looking to attract readers to your WordPress-powered writing, distributing a printed “teaser” version might just help.