WordPress.org

Ready to get started?Download WordPress

Forums

WP Post to PDF
[resolved] Displaying a simple text footer (5 posts)

  1. outofhouse
    Member
    Posted 1 year ago #

    Hi

    Very easy plugin to use!

    Is there any way I can add some text to the php file that will appear at the end of my post as a default footer?

    Any help much appreciated!

    http://wordpress.org/extend/plugins/wp-post-to-pdf/

  2. outofhouse
    Member
    Posted 1 year ago #

    If so, where would I place the code?

    Something like:

    <?php
    echo $myString;
    echo"<p>Notes to the editor<p/>;
    ?>
  3. Neerav Dobaria
    Member
    Plugin Author

    Posted 1 year ago #

    Instruction for version 2.3.1

    In file wp-post-to-pdf/wp-post-to-pdf.php

    Append your code to $html variable after line 342

    $html .= $myString;
    $html .= "<p>Notes to the editor<p/>";

  4. outofhouse
    Member
    Posted 1 year ago #

    Hi Neerav

    Doesn't seem to be working for me!
    Here's where I put the code:

    $html .= htmlspecialchars_decode(htmlentities($post->post_content, ENT_NOQUOTES, 'UTF-8', false), ENT_NOQUOTES);
                $dom = new simple_html_dom();
                $dom->load($html);
    
                foreach($dom->find('img') as $e){
                    $e->align = null;
                    $e->outertext = '<div style="text-align:center;">' . $e->outertext . '</div>';
                }
    
                $html = $dom->save();
    
                $dom->clear();
                $html .= $myString;
    $html .= "<p>Notes to the editor<p/>";
    
                // Print text using writeHTML
                $pdf->writeHTML($html, true, 0, true, 0);
    
                // ---------------------------------------------------------
                // Close and output PDF document
                // This method has several options, check the source code documentation for more information.

    website: http://www.ooh-websites.co.uk/ovalmedical/oval-medical-collaborates-with-the-cambridge-university-mba-venture-project-2/

    Any ideas or have I simply put it in the wrong place?!

  5. Neerav Dobaria
    Member
    Plugin Author

    Posted 1 year ago #

    You have put the code at right place.

    I suspect you forget to delete cached PDF files. You can delete them from WP Post to PDF settings page.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic