• Resolved Ismael Latorre

    (@miguelripoll)


    Hi,

    Is there any way to make the notes appear when converting posts to PDF? (I am using a specific plugin for this, but although notes print well on paper (on the side), they don’t appear when a pdf file is created, as they are coded as title tags within the anchor). Is there a nifty php function or css snippet I could use to make pdfs or print versions generated from the posts print the title tags, say, at the bottom of the page?

    Many thanks!

    https://www.ads-software.com/plugins/side-matter/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author setzer

    (@setzer)

    Hi miguelripoll,

    Good question. The developer of your PDF plugin would be better equipped to answer this question, but I’ll help if I can.

    Side Matter actually generates the note text in two places: the reference’s title attribute (as you found), and an ol (ordered list) in the sidebar widget. I’d guess that your PDF plugin excludes sidebar content when converting the post, so the SM widget list doesn’t appear.

    The PHP snippet do_action( 'side_matter_list_notes' ); will print the list of sidenotes anywhere you stick it, so perhaps you could add that to the printing queue of the PDF plugin, after the post content.

    What plugin are you using?

    Thread Starter Ismael Latorre

    (@miguelripoll)

    Hi,

    I am using the most current, and IMHO best, pdf plugin out there at the moment: https://www.ads-software.com/plugins/wp-post-to-pdf-enhanced/

    I am wary of tweaking with the plugin itself, which would interfere with future upgrades, and I’d rather do this via a theme function or a separate add-on…

    Plugin Author setzer

    (@setzer)

    Hi miguelripoli,

    I’ve taken a look at that PDF plugin. Right now, there isn’t a simple way to do this without editing the plugin or writing a fair amount of code yourself.

    Here’s a simple hack that will do the job, though it does require editing side-matter.php and so won’t be preserved over updates. Insert the following line of PHP between lines 495 and 496 of side-matter.php (1.4):

    $ref_output .= "<span style='display: none;'> [{$note_id}. {$note_text}]</span>";

    This appends the note text to each reference in brackets, but gives it a CSS property of display: none, making it (generally) not shown in the browser but visible on the PDF. You have to turn on the PDF plugin’s “Process Shortcodes” option for this to work.

    Thread Starter Ismael Latorre

    (@miguelripoll)

    Hi,

    This works. Thanks very much for your help with this, and for your work on this superb plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PDF and print integration’ is closed to new replies.