This plugin utilises the DOMPDF Library to provide a URL endpoint e.g. /my-post/pdf/ that generates a downloadable PDF file.
|Author:||@anttiviljami (profile at wordpress.org)|
|WordPress version required:||4.0|
|WordPress version tested:||4.4.10|
|Added to WordPress repository:||24-06-2014|
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|Total downloads:||16 625|
Click to start download
- Download and activate the plugin.
- Installation done! You can now navigate to any post or page on your website and append /pdf/ (or &pdf if not using pretty permalinks) to the URL to view a glorious PDF version of it.
I activated the plugin but can’t see any difference. What do I do?
WordPress PDF Templates works quietly in the backround without cluttering your wp-admin with unnecessary menus and views.
To see this plugin in action, try navigating to any post or page on your site and appending /pdf/ to the URL.
My PDF is displaying the wrong post content
Is your content access-restricted? In that case, all you need to do is enable cookies for the plugin with
define('FETCH_COOKIES_ENABLED', true); in your wp-config.php
You can also try clearing the PDF cache by hard-refreshing your browser or disabling the PDF cache altogether with
define( 'DISABLE_PDF_CACHE', true )
How do I enable PDF Templates for custom post types?
You can define supported post types in your theme functions.php with
The set_pdf_print_support function takes an array of post types (strings) as a parameter.
// add pdf print support to post type ‘product’
set_pdf_print_support(array(‘post’, ‘page’, ‘product’));
I don’t like the way my PDF printing looks. How do I change it?
Just copy index-pdf.php from wp-content/plugins/wp-pdf-templates/ into your theme directory and start editing!
If you wish to define different templates for different post types, you can do that too! Let’s say you wish to create a new PDF template for pages. Just create a file called ‘page-pdf.php’ and create your template there. Note that this only works when a page.php exists in your theme.
Can I change the PDF output paper size, orientation or DPI?
Yes! You can define settings for the DOMPDF Library by editing your wp-config.php.
// use landscape A4 sized paper @ 180 DPI
See DOMPDF documentation for more options.
My fonts don’t show in the PDF. Can I fix that?
DOMPDF needs the proper font files to generate PDF files. There’s a font adder utility built in to DOMPDF you can use to import any TrueType fonts. See this link for instructions: https://code.google.com/p/dompdf/wiki/Installation
* Automatically fall back to http if https doesn’t work
* Updated to newest version of DOMPDF, attribute plugin to @anttiviljami instead of Seravo
- Just marking compatibility and small cleanup
- Cookies are now passed as a raw header for a simpler system
- Added more cookie logic and a fix for non-encoded cookies
- General cleanup of documentation & code
- Request cookie relaying is now optional and disabled by default
- If this update causes any issues, try enabling the constant FETCH_COOKIES_ENABLED
- Custom fonts are now retained in plugin updates
- PHP 5.2 compatibility added, upgraded to newest version of dompdf lib
- Fixes issue with pretty permalinks disabled. Thanks Triskal!
- Cookies added to template requests
- HTML output is no longer based on output buffering, which makes everything more stable
- Initial release to WordPress.org