Hi,
I'm having a problem applying a security policy to an existing PDF document. I want to allow opening, printing and copying of the document but not allow editing.
I thought this C# snippet would work but I'm being prompted for the password just to open the document. (It appears AllowAccessibility is True by default.)
...
doc.Security = new Aes256Security() { AllowEdit = false };
var bytes = doc.Draw();
...
Am I using this incorrectly?
Thanks.
PDF Security - No Edit Policy
Re: PDF Security - No Edit Policy
Support · Aug 19, 2022Hi,
You can make the PDF non-edible using our DynamicPDF Core Suite for .NET product. Please try setting IsReadOnly boolean to true and see if it works for you.
Here is a code sample.
PdfDocument pdf = new PdfDocument(@"Input file path");
MergeDocument document = new MergeDocument(pdf);
document.Form.IsReadOnly = true;
string output = @"C:\Temp\MyDocument.pdf";
document.Draw(output);
If you continue facing an issue, then please send over the following information to [^a|mailto:support@dynamicpdf.com|opennewwindow|support@dynamicpdf.com^] so we can look into it further.
1. Source PDF used for merging.
2. Output PDF.
3. Code sample which uses static data to recreate the error.
4. More information on what you are trying to achieve by referring to the output PDF.
5. Exact version and build number of the DynamicPDF Core Suite DLL used in your application. You can find this information by right clicking on the DLL file>>Properties>>Details tab>>Product version. Take a screenshot of the Details tab and send it over to us.
Thanks,
ceTe Software Support Team