AllowFormFilling is set in code, but doesn't "take"

AllowFormFilling is set in code, but doesn't "take"

Forum member · Aug 11, 2010
After building a PDF (using a MergeDocument and filling in a bunch of form fields), we have some code that sets the security on the PDF. Recently, I needed a variation on the security to allow a 3rd party to access one our PDFs. So we now have code like: HighSecurity sec = new HighSecurity(); sec.OwnerPassword = GetDocOwnerPassword(); if (bSetSecurity) { sec.AllowEdit = false; } sec.AllowFormFilling = false; sec.AllowUpdateAnnotsAndFields = false; doc.Security = sec; The code runs, no errors or complaints. But, when I open the resulting PDF in Reader or Acrobat, then go to the Security tab on Document Properties window, it shows Filling of form fields: Allowed And, what the real problem seems to be is that everytime our 3rd party opens the doc, they are prompted to save changes to the document (even though no changes where made). Any advise?

Re: AllowFormFilling is set in code, but doesn't "take"

Support · Aug 11, 2010
Hello, Can you please send over the input PDF and the code you are using to our [^a|mailto:support@cete.com|Support Team^] so that they can look into this issue further? Thanks, ceTe Software Support Team.

Re: AllowFormFilling is set in code, but doesn't "take"

Forum member · Aug 11, 2010
I have just an email with a sample attachment.

Re: AllowFormFilling is set in code, but doesn't "take"

Support · Aug 26, 2010
Hello, In order to make the fields not editable and to make the "Filling of Form Fields" in security tab of the document properties to "Not Allowed", we will have to use 3 properties from our Security object. Below is the sample code for this and this should solve your problem. PdfDocument pdf = new PdfDocument(@"D:\Test\fw9AcroForm_03.pdf"); MergeDocument doc = new MergeDocument(pdf); HighSecurity sec = new HighSecurity(); sec.AllowUpdateAnnotsAndFields = false; sec.AllowEdit = false; sec.AllowFormFilling = false; doc.Security = sec; doc.Draw(@"D:\Test\output.pdf"); Thanks, ceTe Software Support Team.