PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Document "SecuritySettings"
http://forum.pdfsharp.com/viewtopic.php?f=3&t=708
Page 1 of 1

Author:  goopyJava [ Tue Apr 21, 2009 1:13 am ]
Post subject:  Document "SecuritySettings"

I have been working with converting some documents I am drawing with GDI+ into standard PDF documents. Everything seems to be working great but as icing on the cake I decided to add in security on those new documents so my users can protect the information they are sending around. The problem is that in Acrobat 9.1.0 it seems like the security shows up fine in the "show details..." screen but not under the "Document Restrictions Summary". All this is to say that no matter what I set the security to be, it is not enforced.

A very rough version of my code is:

Code:
     // create the document here
     ...

     // apply the security settings
     objDocument.SecuritySettings.UserPassword = "user";
     objDocument.SecuritySettings.PermitPrint = false;
     objDocument.SecuritySettings.PermitExtractContent = false;

     // draw many graphics
     ...

     // close the document
     objDocument.Close();


When I open the result of this code in Acrobat Reader 9.1.0 the user can still print, and copy content. I looked into the actual PDFSharp code and compared with the PDF specification but I cannot figure out what might be missing. Any ideas what is wrong?

Author:  chapas [ Wed Jun 24, 2009 5:08 pm ]
Post subject:  Re: Document "SecuritySettings"

Hello,
i was having the same problem. Just define the OwnerPassword write only property.

ex:
document.SecuritySettings.OwnerPassword = "noPrintingAllowed"

chapas

Author:  goopyJava [ Wed Jun 24, 2009 6:24 pm ]
Post subject:  Re: Document "SecuritySettings"

Thank you for the reply. Unfortunately the "solution" does not work. I have tried each of the various settings, including the owner password, but to no avail. I believe the core issue is that Acrobat Reader "9" doesn't respect the security settings. Earlier versions of adobe reader as well as Foxit seemed to respect these settings. This would work except that I expect most to be using the latest reader, making the security worthless. If anyone else has any ideas I'm still always looking for suggestions.

Author:  philfordjour [ Thu May 29, 2014 11:47 pm ]
Post subject:  Re: Document "SecuritySettings"

To enforce PDF security features, you need to set the encryption to 128 Bit or 40 bit.
Code:
document.securitySettings.DocumentSecurityLevel = PdfDocumentSecurityLevel.Encrypted128Bit

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/