I need to merge two PDFs together. One will be an overlay file containing artwork and some Acro fields, and the other will contain invoice data.
I am using the following code for testing:
private void MergePDF()
{
string dataPDF = @"C:\Data.Pdf";
string overlayPDF = @"C:\Overlay.Pdf";
var overlayPage = new ImportedPageArea(overlayPDF, 1, 0, 0) { Contents = { ClipLeft = 0, ClipTop = 0, ClipRight = 0, ClipBottom = 0 }};
var dataPage = new ImportedPageArea(dataPDF, 1, 0, 0) { Contents = { ClipLeft = 0, ClipTop = 0, ClipRight = 0, ClipBottom = 0 }};
var page = new ceTe.DynamicPDF.Page(PageSize.A4, PageOrientation.Portrait) { Dimensions = { LeftMargin = 0, TopMargin = 0 }};
page.Elements.Add(overlayPage);
page.Elements.Add(dataPage);
var document = new ceTe.DynamicPDF.Document();
document.Pages.Add(page);
document.Draw(@"C:\Result.pdf");
}
The Acro fields not appearing on the merged Pdf.
Can anyone help me with this please?
Merging PDFs with Acro Fields
Re: Merging PDFs with Acro Fields
Support · Mar 12, 2015Hello,
You are seeing this behavior because of using ImportedPageArea to import the data from a PDF that contains acro fields. The ImportePageArea is not capable of importing acro fields. You have to use ImportePage object and below is the code sample for it.
string dataPDF = @"C:\Data.Pdf";
string overlayPDF = @"C:\Overlay.Pdf";
ImportedPage page = new ImportedPage(overlayPDF, 1);
var dataPage = new ImportedPageArea(dataPDF, 1, 0, 0) { Contents = { ClipLeft = 0, ClipTop = 0, ClipRight = 0, ClipBottom = 0 } };
page.Elements.Add(dataPage);
var document = new ceTe.DynamicPDF.Document();
document.Pages.Add(page);
document.Draw(@"C:\Result.pdf");
Thanks,
ceTe Software support Team.
Re: Merging PDFs with Acro Fields
Forum member · Mar 12, 2015Thank you. That is working now.