Support » Plugin: WP Post to PDF Enhanced » Add document security

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Plugin Author Lewis Rosenthal



    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!

    Thanks Lewis for the advice and quick response… and for teaching me the word “paraprosedokian” 😉

    Plugin Author Lewis Rosenthal


    You bet!

    Great word, isn’t it? 🙂


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add document security’ is closed to new replies.