WordPress.org

Ready to get started?Download WordPress

Forums

WP Post to PDF Enhanced
[resolved] HTML output of the PDF (2 posts)

  1. Kristy Sullivan
    Member
    Posted 3 months ago #

    Hello, I really like your plug-in. I was wondering what the HTML output is for the PDF so I can customize some things out the output via CSS on my end. There are a bunch of options that are not available apparently yet in the admin.

    https://wordpress.org/plugins/wp-post-to-pdf-enhanced/

  2. Lewis Rosenthal
    Member
    Plugin Author

    Posted 3 months ago #

    Hi, Kristy, and apologies for the late follow-up.

    You can stall the output of the PDF by inserting the following code in the main plugin class (wp-post-to-pdf-enhanced.php):

    echo( $html );

    just above the lines:

    // Print text using writeHTML
    $pdf->writeHTML($html, true, 0, true, 0);

    This should show you the HTML at the top of the opened browser window/tab and the PDF source below it. Some elements will not be rendered (the header and footer content), as these are rendered on-the-fly by TCPDF, and ae only inserted into the PDF. I'm not aware of a means of getting TCPDF to dump its work-in-progress, but that would indeed be handy.

    I should probably add a debug flag for this. It's not exact, however, because just as some content is rendered by TCPDF itself, the HTML here is interpreted by TCPDF - and sometimes, in unexpected ways. Still, it's better than flying completely blind.

    HTH

    Lewis

Reply

You must log in to post.

About this Plugin

About this Topic