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 'pdfprntpr_pdf'(pdfprntpr_print) in order to add some styles only for PDF(Print) pages.

(To display "edit styles" field go Dashboard->BWS Plugins->PDF & Print Pro 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;
    } 
);
Have more questions? Submit a request