WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. jlibrizzi
    Member
    Posted 3 months 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.

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

  2. jlibrizzi
    Member
    Posted 3 months 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
    Member
    Plugin Author

    Posted 3 months 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. ;-)

    Cheers

    Lewis

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

  4. jlibrizzi
    Member
    Posted 3 months ago #

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

  5. Lewis Rosenthal
    Member
    Plugin Author

    Posted 3 months ago #

    You bet!

    Great word, isn't it? :-)

    Cheers

Reply

You must log in to post.

About this Plugin

About this Topic

Tags