Category / Section
How to preserve form fields while overlaying documents?
1 min read
To preserve form fields while overlaying documents, you can load the PDF that contains forms in PdfLoadedDocument and then draw the overlay PDF as a template in the loaded document.
Refer to the following code example to achieve the above.
C#
// Load the border template
PdfLoadedDocument ldDoc1 = new PdfLoadedDocument(@"BorderTemplate.pdf");
// Load the Form document
PdfLoadedDocument ldDoc2 = new PdfLoadedDocument(@"Form.pdf");
// Draw the border template in the form document
for (int i = 0, count = ldDoc2.Pages.Count; i < count; ++i)
{
PdfPageBase lpage = ldDoc1.Pages[0];
PdfTemplate template = lpage.CreateTemplate();
ldDoc2.Pages[i].Graphics.DrawPdfTemplate(template, PointF.Empty, ldDoc2.Pages[i].Graphics.ClientSize.ToSize());
}
Sample Link:
http://www.syncfusion.com/downloads/support/directtrac/general/OverlayForms-354894904.zip
Didn't find an answer?
Contact Support