• Resolved Colin

    (@colinsafranek)


    In the features list for the pro version it says that custom templates are possible for the header and footer of the PDF documents.

    I need to be able to create totally custom PDF templates, with custom queries for custom post types, custom header/footer for each post type, custom CSS, etc. Is this possible with the pro version? For example:

    single-custom-post.php (for the web version)
    single-custom-post-pdf.php (for the PDF version)

    Also, my website is a membership business model, and the PDF export feature is only available to paid members. This means that the PDF templates need to have the ability to access current user data and check for user role and membership status (custom function) before rendering protected content. Is this possible with the pro version?

    Thank you in advance for your response.

    Cheers!

Viewing 1 replies (of 1 total)
  • Plugin Author bestwebsoft

    (@bestwebsoft)

    Hi,

    Thank you for contacting us.

    “In the features list for the pro version it says that custom templates are possible for the header and footer of the PDF documents.”

    Yes, Pro version provides an ability to add customized running titles to both pdf and print documents.

    “I need to be able to create totally custom PDF templates, with custom queries for custom post types
    the PDF templates need to have the ability to access current user data and check for user role and membership status (custom function) before rendering protected content.”

    Both Free and Pro versions of plugin provide an ability to customize the content of PDF document.
    You can use the following filter to change the main content of pdf/print document:
    add_filter( 'bwsplgns_get_pdf_print_content', {your_function} );
    For example, go to the plugin settings page, open “Custom code” tab, mark “Activate” checkbox in the “Editing bws-custom-code.php” section and add the following code:

    add_filter(
        'bwsplgns_get_pdf_print_content', 
        function( $content ) {
            $my_content   = "Lorem ipsum dolor sit amet";
            $more_content = 'Donec fringilla libero ac sapien';
    
            /* 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;
        }
    );

    You can also add your code to check user role condition and only after that return the PDF content.
    For more information about WordPress filters see here – https://codex.wordpress.org/Function_Reference/add_filter

    “I need to be able to create custom header/footer for each post type, custom CSS, etc.
    You can add custom css styles for different post types by modifying the content of the print document and adding different CSS classes for different post types.”

    At the moment our Pro plugin version provides an ability to select which running titles will be added to the PDF and Print documents.
    There is no ability to add different running titles to different PDF documents. Such customization is possible. You can hire our specialist who will make required changes.

    Please note that if you’ll have some difficulties with adding the functionality for the content displaying, you can contact us and we’ll be glad to help you, but it’s a paid service.

    Sincerely,
    BestWebSoft Support Team

Viewing 1 replies (of 1 total)
  • The topic ‘Custom PDF templates?’ is closed to new replies.