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

When I open the pdf the fields are editable?
http://forum.pdfsharp.com/viewtopic.php?f=2&t=2766
Page 1 of 1

Author:  mathacka [ Mon Mar 17, 2014 7:29 pm ]
Post subject:  When I open the pdf the fields are editable?

Hi, I'm working through a former co-workers PDFSharp code. At the moment it is filling out the fields correctly and saving the document, but when we open the document the fields are editable, is there a switch that I should be making in code to turn this feature off?

It's opened by:

Code:
PdfDocument template = PdfReader.Open(template_path, PdfDocumentOpenMode.Modify);


and edits the fields by:

Code:
form.Elements.Add("/NeedAppearances", new PdfBoolean(true));


then closes with a memory stream:

Code:
byte[] output = null;
MemoryStream MS = new MemoryStream();
template.Save(MS);
output = MS.ToArray();             
return output;


so am I missing a simple fix?

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