Title: Add document security
Last modified: August 21, 2016

---

# Add document security

 *  Resolved [jlibrizzi](https://wordpress.org/support/users/jlibrizzi/)
 * (@jlibrizzi)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/add-document-security/)
 * 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/](https://wordpress.org/plugins/wp-post-to-pdf-enhanced/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [jlibrizzi](https://wordpress.org/support/users/jlibrizzi/)
 * (@jlibrizzi)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/add-document-security/#post-4769084)
 * Just a quick note – while looking around the TCPDF documentation I did find reference
   to the [SetProtection method](http://www.tcpdf.org/doc/code/classTCPDF.html#a7ea250b2b4e3d7e55e657d52732a3b1d)
   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](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/add-document-security/#post-4769096)
 * 🙂
 * 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!
 *  Thread Starter [jlibrizzi](https://wordpress.org/support/users/jlibrizzi/)
 * (@jlibrizzi)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/add-document-security/#post-4769097)
 * Thanks Lewis for the advice and quick response… and for teaching me the word “
   paraprosedokian” 😉
 *  Plugin Author [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * (@lewisr)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/add-document-security/#post-4769100)
 * You bet!
 * Great word, isn’t it? 🙂
 * Cheers

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Add document security’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-post-to-pdf-enhanced_d24b30.svg)
 * [WP Post to PDF Enhanced](https://wordpress.org/plugins/wp-post-to-pdf-enhanced/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-post-to-pdf-enhanced/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-post-to-pdf-enhanced/reviews/)

## Tags

 * [pdf](https://wordpress.org/support/topic-tag/pdf/)

 * 4 replies
 * 2 participants
 * Last reply from: [Lewis Rosenthal](https://wordpress.org/support/users/lewisr/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/add-document-security/#post-4769100)
 * Status: resolved