WordPress.org

Plugin Directory

PDF & Print by BestWebSoft

Generate PDF files and print WordPress posts/pages. Customize document header/footer styles and appearance.

How to change position buttons in content

Go to the Settings page and change value for the 'Position of buttons in the content' field.

How to change position buttons in search or archives pages

Go to the Settings page and change necessary values for the 'Search and archive pages' column.

Buttons for content do not appear on page

Go to the Settings page and change value for the 'Show PDF button' or 'Show Print button' fields.

Why are PDF and Print buttons not displayed in the custom post type ?

  1. Please make sure that the necessary custom post type is selected in the "Types of posts that will be used in the plugin" setting block. If necessary, select the post type and save changes.
  2. Check displaying the buttons on the specified pages in the front end of your site.

If buttons are still not displayed, please complete the following:

  1. Try activating a standard WordPress theme for a while (Twenty Fifteen, Twenty Sixteen) and check if the problem remains.
  2. Try deactivating all of your plugins except PDF & Print by BestWebsoft and also check if the problem is still present. If it is not, activate the plugins one-by-one, meanwhile checking, after which plugin activation the problem appears again.

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
<?php do_action( 'bwsplgns_display_pdf_print_buttons', 'top' ); ?>
  • in the bottom of the post or page template
<?php do_action( 'bwsplgns_display_pdf_print_buttons', 'bottom' ); ?>

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.

Why in pdf/print-document displayed not all information from page

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).

If I have shortcode on the page, but I don't want them to be printed (add to pdf)

Go to the Settings page and unmark checkbox 'Settings for shortcodes'.

How can I change the content pdf/print document?

  • in order to change main content of pdf/print document you can use following filter:
add_filter( 'bwsplgns_get_pdf_print_content', {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, add the following code to the 'functions.php' file of your theme:

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.

How can I add different styles to PDF and Print pages?

To do that, enter the required styles in the "edit styles" field on the Settings page. You can use the class 'pdfprnt_print' in order to add some styles only for Print pages.

( To display "edit styles" field go Dashboard->BWS Panel->PDF & Print and mark "Add custom styles" checkbox )

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.

  1. upload these files to the folder 'wp-content/uploads' via FTP.
  2. add the following code to the 'functions.php' file of your theme:
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;
    }
);

I get an error "Warning: file_put_contents(/public_html/wp-content/plugins/pdf-print/mpdf/ttfontdata/dejavusanscondensed.GSUBGPOStables.dat): failed to open stream: Permission denied in /***/wp-content/plugins/pdf-print/mpdf/classes/ttfontsuni.php on line 1145". What can I do?

Probably, you don't have sufficient access permissions to files and folders.

To solve this, please try the following:

  1. using FTP, please go to the folder "/public_html/wp-content/plugins/pdf-print"
  2. please check what permissions are set on the "mpdf" folder (755 must be set for the folder and 644 for files)
  3. if there are another permissions set, please change them

For more info see Changing File Permissions.

How can I load additional fonts for MPDF library?

Please follow the next steps:

  1. go to the plugin`s settings page
  2. click "Load Fonts" button

or

  1. download MPDF library by link http://www.mpdfonline.com/repos/MPDF_6_0.zip
  2. using FTP, load the file MPDF_6_0.zip to the folder "{your_site_home_folder}/wp-content/uploads"
  3. go to the plugin`s settings page
  4. click "Load Fonts" button

I have some problems with the plugin's work. What Information should I provide to receive proper support?

Please make sure that the problem hasn't been discussed yet on our forum (http://support.bestwebsoft.com). If no, please provide the following data along with your problem's description:

  1. the link to the page where the problem occurs
  2. the name of the plugin and its version. If you are using a pro version - your order number.
  3. the version of your WordPress installation
  4. copy and paste into the message your system status report. Please read more here: Instruction on System Status

Requires: 3.8 or higher
Compatible up to: 4.6.1
Last Updated: 4 weeks ago
Active Installs: 9,000+

Ratings

4.4 out of 5 stars

Support

0 of 1 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,4,4
100,4,4
100,4,4
100,4,4
100,4,4
100,4,4
100,4,4
100,4,4
100,4,4
100,5,5
100,1,1 100,2,2
100,4,4 100,1,1
100,2,2
100,1,1
100,1,1
100,1,1