I'm loading a PDF into a PdfDocument, and then loading that into a MergeDocument so that I can add some additional fields.
The problem that I'm running into is that the original PDF has some fields which are readonly. Once I load the PDF into the MergeDocument, those settings are lost.
Is there a solution or work around for this?
My code is below:
byte[] form = workitemsService.GetFormPdf(WorkitemId);
MergeDocument mergeDocument = new MergeDocument(formsDocument, MergeOptions.All);
mergeDocument.Form.NeedsAppearances = true;
ceTe.DynamicPDF.PageElements.Forms.Button btnSubmit = new ceTe.DynamicPDF.PageElements.Forms.Button("btnSubmit", 0, 0, 100, 25);
btnSubmit.Behavior = Behavior.Push;
btnSubmit.Label = "Save";
btnSubmit.Action = new SubmitAction(String.Format("http://{0}{1}", Request.Url.Host, ResolveUrl("SaveForm.aspx")));
mergeDocument.Pages[0].Elements.Add(btnSubmit);
MemoryStream ms = new MemoryStream();
mergeDocument.Draw(ms);
Response.ClearHeaders();
Response.AppendHeader("content-disposition", String.Format("attachment; filename={0}", "Forms.pdf"));
Response.ContentType = "application/pdf";
ms.WriteTo(Response.OutputStream);
Thanks for any assistance you can provide.