WP Post to PDF Enhanced
[resolved] Add document security (5 posts)

  1. jlibrizzi
    Posted 2 years ago #

    Hi. Awesome plugin, does exactly what it says it will! One question though - is it possible to apply security to the output PDF? Specifically I'd like to restrict printing and editing which is typically controlled by password security.


  2. jlibrizzi
    Posted 2 years ago #

    Just a quick note - while looking around the TCPDF documentation I did find reference to the SetProtection method which seems to do exactly this and wonder if its something I could call from outside of the plugin if the option is not available within the plugin.

  3. Lewis Rosenthal
    Plugin Author

    Posted 2 years ago #


    Look for these options in an upcoming trunk release, as these are on my near-term roadmap.

    Currently, you need to hack wp-post-to-pdf-enhanced.php manually to add something like:

    $permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high');
    $user_pass = '';
    $owner_pass = null;
    $mode = 0;
    $pubkeys = null;
    $pdf->SetProtection( $permissions, $user_pass, $owner_pass, $mode, $pubkeys );

    somewhere near the upper part of the document (look for references to "creator" - just a WAG, as the code is not handy). Obviously, replace the references to the blank password(s) with your desired settings, and lock down the permissions as you see fit.

    As I say, this is on the near-term list, as I've had someone else request it. These settings can obviously be added to the admin UI, but it's kind of silly to set a single password for every PDF, so shortcodes make more sense. I have a long - and growing longer - list of shortcodes (a paraprosedokian, if ever there was), so expect the global settings well before the customizable ones. ;-)



    PS - Thanks for your kind words. Glad it's working for you!

  4. jlibrizzi
    Posted 2 years ago #

    Thanks Lewis for the advice and quick response... and for teaching me the word "paraprosedokian" ;)

  5. Lewis Rosenthal
    Plugin Author

    Posted 2 years ago #

    You bet!

    Great word, isn't it? :-)


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Post to PDF Enhanced
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic