Password protecting

14 views
Skip to first unread message

tracy rickman

unread,
Aug 27, 2013, 4:45:25 PM8/27/13
to dot-net-...@googlegroups.com
Is there any way to add a password to the PDF?
 
I have a PDF that I will need to email with slightly sensitive data in it.
I need to be able to secure it with a password.
 
Thanks,
Tracy

siberix

unread,
Aug 27, 2013, 7:17:36 PM8/27/13
to
Hi Tracy,

You can use the following lines:

// Encryption
report.Preferences.PDF.Encryptor.Password.User = "test";
report.Preferences.PDF.Encryptor.Password.Owner = "siberix";

report.Preferences.PDF.Encryptor.Permissions.Add = false;
report.Preferences.PDF.Encryptor.Permissions.Copy = false;
report.Preferences.PDF.Encryptor.Permissions.Modify = false;
report.Preferences.PDF.Encryptor.Permissions.Print = true;

or in XML:

<?xml version="1.0"?>
<Report>
<Preferences>
<PDF ColorSpace="RGB">
<Encryptor>
<Password Owner="siberix" User="test" />
<Permissions Add="False" Copy="False" Modify="False" Print="True" />
</Encryptor>
</PDF>
</Preferences>
<Sections>
...
</Sections>
</Report>

Thank You,
Victor
Reply all
Reply to author
Forward
0 new messages