Locking down a pdf

My goal is to take an existing PDF and lock it down. That is, make the PDF so that you cannot select elements in the PDF and copy them to the clipboard. I also want to disable all Print and Save As actions. This includes toolbar menus, right click actions, and keyboard short cuts. What’s the best way to do this in Java? Thanks.

There is no effective way to protect PDF document with standard security. Instead of using PDF directly you may want to go with the WebViewer (http://www.pdftron.com/webviewer).

With WebViewer you have full control over the UI and can also encrypt document making it extremely difficult for someone to steal your content.

In case you must work with standard PDF you could use the approach shown in EncTest sample that comes as part of PDFNet SDK. To lock down PDF as much as possible you should set more of the flags to

false: e_doc_modify e_print e_print_high e_extract_content e_mod_annot e_fill_forms e_access_support

e_assemble_doc … Please keep in mind that PDF security model is based on ‘trust’, which means that PDF consumer app decides whether to respect permission or not. Many PDF consumers do not respect permissions (so even though the flag is set, you can still extract text).