Generate PDF files and print WordPress posts/pages. Customize document header/footer styles and appearance.
With this plugin you can create PDF files and print pages quickly. Add PDF & print buttons to WordPress website pages, posts, and widgets.
Generate documents with custom styles and useful data for archiving, sharing, or saving.
Pro Features
All features from Free version included plus:
- Add text or image watermark
- Prevent copying of PDF file content
- Customize watermark opacity
- Create custom document header and footer templates with:
- Images
- Text
- Date created
- Source page URL
- Post date (current date for search and archive pages)
- Current page number (for PDF only)
- Total pages count in document (for PDF only)
- Post author (for single posts or pages only)
- Compatibility with Advanced Custom Fields
- Set custom top and bottom margins for running title
- Add and manage:
- Custom fields
- Custom data
- Add custom fields/custom data:
- Before content
- After content
- WooCommerce compatibility
- Set PDF layout:
- Portrait
- Landscape
- Set custom images for buttons
- Disable PDF & Print buttons for certain pages and/or post types
- Disable PDF & Print buttons for certain users and/or roles types
- Additional Elements to single post type [NEW]
- Dinamic URI for PDF document [NEW]
- Change default PDF file name
- Prevent search engines from indexing links in documents
- Add custom code via plugin settings page
- Configure all subsites on the network
- Get answer to your support question within one business day (Support Policy)
If you have a feature suggestion or idea you’d like to see in the plugin, we’d love to hear about it! Suggest a Feature
Visit our Help Center if you have any questions, our friendly Support Team is happy to help – https://support.bestwebsoft.com/
Earn 20% commission by selling the premium WordPress plugins and themes by BestWebSoft — https://bestwebsoft.com/affiliate/
Some of these translations are not complete. We are constantly adding new features which should be translated. If you would like to create your own language pack or update the existing one, you can send the text of PO and MO files to BestWebSoft and we’ll add it to the plugin. You can download the latest version of the program for work with PO and MO files Poedit.
pdf-print
folder to the /wp-content/plugins/
directory.View a Step-by-step Instruction on PDF & Print Installation
Displaying PDF&Print buttons in the post on your WordPress website.
Displaying PDF&Print buttons on archive page of your WordPress website.
Displaying PDF&Print buttons in widget.
Printing output page example.
PDF output page example.
Settings page (Settings tab) for the PDF&Print in admin panel.
Settings page (Output tab) for the PDF&Print in admin panel.
Go to the Settings page and change value for the ‘Add Button to’ option.
If buttons are still not displayed, please complete the following:
Also, if you are using custom template you should paste the following string to the custom post or page template in order to use PDF and Print buttons:
in the top of the post or page template
in the bottom of the post or page template
You can specify some query parameters for your post. For example:
<?php do_action( 'bwsplgns_display_pdf_print_buttons', 'bottom', 'post_type=gallery&orderby=post_date' ); ?>
or
<?php do_action( 'bwsplgns_display_pdf_print_buttons', 'bottom', array( 'post_type'=>'gallery', 'orderby'=>'post_date' ) ); ?>
For more information on the syntax for assigning parameters to function see here.
For generating a pdf/print page version, PDF & Print plugin uses the content that is featured in the body of post/page before it is displayed by the browser (i.e. the data featured in the main block on this post/page in the edit mode).
Go to the Settings page and unmark checkbox ‘Print Shortcodes’.
You can use following filters if “Full Page PDF” option is disabled:
in order to change main content of pdf/print document
add_filter( ‘bwsplgns_get_pdf_print_content’, {your_function} );
in order to change top running title
add_filter( ‘bwsplgns_top_running_title’, {your_function} );
in order to change bottom running title
add_filter( ‘bwsplgns_bottom_running_title’, {your_function} );
in order to change the title of pdf/print document
add_filter( ‘bwsplgns_get_pdf_print_title’, {your_function}, 10, 2 );
For example, go to the plugin settings page -> “Custom Code” tab, mark “Activate custom PHP code.” checkbox in the “PHP” section and add the following code:
add_filter( 'bwsplgns_get_pdf_print_content', function( $content ) { $my_content = '<p>Lorem ipsum dolor sit amet</p>'; $more_content = '<p>Donec fringilla libero ac sapien</p>'; /* if you want add some data before to the main content */ return $my_content . $content; /* if you want add some data after the main content */ return $content . $my_content; /* if you want add some data both sides the main content */ return $my_content . $content . $more_content; /* if you want add some data instead of the main content */ return $my_content; } );
For more information about WordPress filters see here.
If “Full Page PDF” option is enabled please use beforeImageToPdf()
and afterImageToPdf()
JavaScript functions for changing PDF document.
For example, go to the plugin settings page -> “Custom Code” tab, mark “Activate custom JavaScript code.” checkbox in the “JavaScript” section and add the following code:
function beforeImageToPdf() { document.getElementById("site-header").style.display = "none"; } function afterImageToPdf() { document.getElementById("site-header").style.display = "block"; }
Replace “site-header” on the id of the element you need to hide.
To do that, go to Dashboard->PDF & Print->Output and mark “Custom CSS” checkbox. Enter the required styles in the “Custom CSS” field. You can use the class ‘pdfprnt_print’ in order to add some styles only for Print pages.
For example:
body p { color: green; } .pdfprnt_print p { color: red; }
Also you can use filter ‘bwsplgns_add_pdf_print_styles’ to include additional css-files.
For example:
Let’s imagine that you have files style.css, style_print.css and style_pdf.css and you want include them to your PDF or Print pages.
Mark “Activate custom PHP code” checkbox in “PHP” section and insert the following code:
add_filter(
‘bwsplgns_add_pdf_print_styles’,
function( $styles ) {
$styles[] = array( ‘wp-content/uploads/style_pdf.css’, ‘pdf’ ); /* file will be included to PDF pages /
$styles[] = array( ‘wp-content/uploads/style_print.css’, ‘print’ ); / file will be included only to Print pages /
$styles[] = array( ‘wp-content/uploads/style.css’ ); / file will be included to PDF and Print pages */
return $styles;
}
);
Probably, you don’t have sufficient access permissions to files and folders.
To solve this, please try the following:
For more info see Changing File Permissions.
Please follow the next steps:
or
Please make sure that the problem hasn’t been discussed yet on our forum (https://support.bestwebsoft.com). If no, please provide the following data along with your problem’s description:
To remove the shortcode, please use ‘bwsplgns_pdf_print_remove_shortcodes’ hook:
Add the following code (as example):
function pdf_print_remove_shortcodes( $shortcodes_array ) {
$shortcodes_array[] = ‘bestwebsoft_contact_form’;
return $shortcodes_array;
}
add_filter( ‘bwsplgns_pdf_print_remove_shortcodes’, ‘pdf_print_remove_shortcodes’ );
Replace bestwebsoft_contact_form
with your shortcode.