Hi,
I'm currently using Dynamic PDF Generator version 4.0.3.20, but I would like to know if there is anyway that I can change the security properties on my PDF after the Draw() function. The issue we are having is that when we are trying to send the PDF as a Fax using (OMTOOL Fax Server) we are having a issue with that program and is not sending the fax, I'm not sure is it is one of this properties on the security of the PDF that is not allowing the fax to go through.
security.AllowPrint = False
security.AllowAccessibility = False
security.AllowDocumentAssembly = False
security.AllowFormFilling = False
security.AllowHighResolutionPrinting = False
security.AllowUpdateAnnotsAndFields = False
security.OwnerPassword = "abc"
_pdfDoc.Security = security
Best Regards,
Jessica
Change PDF Security
Re: Change PDF Security
Support · Apr 26, 2011Hello Jessica,
You can change the security of a generated PDF using DynamicPDF Merger Enterprise Edition as long as you know the owner password of that PDF document. DynamicPDF Generator does not have this feature so you will need to upgrade to DynamicPDF Merger Enterprise Edition. Here is the code that you would need to use to be able to open the document after Draw method and modify the security of the object.
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add(page);
// Create a standard security object
StandardSecurity security = new StandardSecurity("owner", "user");
// Set the permissions on that security object
security.AllowPrint = false;
security.AllowCopy = false;
security.AllowEdit = false;
// Add the security object to the document
document.Security = security;
// Create and display a label as a reference
string text = "This document has been encrypted with 40 bit encryption.";
page.Elements.Add(new Label(text, 50, 50, 400, 100, Font.Helvetica, 18));
document.Draw("Test.pdf");
//reopen the generated pdf document to modify the security
PdfDocument pdf = new PdfDocument("Test.pdf", "owner");
MergeDocument doc = new MergeDocument(pdf);
StandardSecurity modifySecurity = new StandardSecurity();
// Set the permissions on that security object
security.AllowPrint = true;
security.AllowCopy = true;
security.AllowEdit = true;
doc.Security = modifySecurity;
doc.Draw("test_modifiedsecurity.pdf");
Thanks,
ceTe Software Support Team.
Re: Change PDF Security
Forum member · Apr 26, 2011Thank you for your prompt response. It really help me a lot.
Jessica