Posted by a ceTe Software moderator
Hello,
Are you trying to do the form flattening after merging the pages by reorganizing the field names? If so you can do this by creating a PdfDocument object with the final PDF after merging the pages. Below is a sample code for this.
PdfDocument pdf = new PdfDocument(@"C:\Temp\document.pdf");
MergeDocument doc = new MergeDocument();
for (int i = 0; i < 5; i++)
{
doc.Append(pdf, 1, 1, new MergeOptions(true, i.ToString()));
}
PdfDocument pdfNew = new PdfDocument(doc.Draw());
MergeDocument docNew = new MergeDocument(pdfNew, MergeOptions.None);
PdfFormField f = pdfNew.Form.Fields["0.f1-1"];
f.CreateLabel(docNew.Pages[f.GetOriginalPageNumber() - 1], "New flattened text", Font.CourierBold, 12);
docNew.DrawToWeb();
Thanks,
ceTe Software Support Team.