How do I remove PDF security (e.g. password & perimissions)?

142 views
Skip to first unread message

Support

unread,
May 23, 2013, 2:44:11 PM5/23/13
to pdfne...@googlegroups.com
 Q:
 

I use the following codes to add security (with password) to a PDF which prevent it from being updated or content extraction.

 

StdSecurityHandler new_handler = new StdSecurityHandler();           

 

            // 2010-05-26, Raymond Lee, Set back master password on PDF

            if ( owner_password != null )

                new_handler.ChangeMasterPassword(owner_password);

 

            // Set Permissions

            new_handler.SetPermission(SecurityHandler.Permission.e_doc_modify, false);

            new_handler.SetPermission(SecurityHandler.Permission.e_assemble_doc, false);

            new_handler.SetPermission(SecurityHandler.Permission.e_extract_content, false);

 

But now I want to remove those permission from the PDFs which has gone through the above settings

And remove the password (i.e. permission security) such that other can modify the content before showing it.

 

I have searched through the google and PDFTron but cannot find example on this purpose.

 

Would you show me any example from PDFTRon samples? Or any URL page to show this?
 
-----------
A:
 
You can simply call pdfdoc.RemoveSecurity(), then save the document.

Reply all
Reply to author
Forward
0 new messages