We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Merging two pages into one page

Does anyone know how I can merge two pages into one? If one document has my letterhead and another document has the text, how can I create a single PDF document with both the letterhead and text on the same page?

1 Reply

BP Bhuvaneswari P Syncfusion Team June 12, 2009 08:59 AM UTC

Hi Thomas,

Thank you for your interest in Syncfusion products.

Yes, it can be possible by using the PDF template and over lay the documents one another. Please find the below code snippet to do so:
/
PdfLoadedDocument ldDoc1 = new PdfLoadedDocument("letterhead.pdf");
PdfLoadedDocument ldDoc2 = new PdfLoadedDocument("text.pdf");
PdfDocument doc = new PdfDocument();

for (int i = 0, count = ldDoc2.Pages.Count; i < count; ++i)
{
PdfPage page = doc.Pages.Add();
PdfGraphics g = page.Graphics;

PdfPageBase lpage = ldDoc2.Pages[i];
PdfTemplate template = lpage.CreateTemplate();

g.DrawPdfTemplate(template, PointF.Empty, page.GetClientSize());

lpage = ldDoc1.Pages[0];
template = lpage.CreateTemplate();

g.DrawPdfTemplate(template, PointF.Empty, page.GetClientSize());
}
doc.Save("sample.pdf");

Also, please refer the Over lay sample from the below browser sample:
\\My Documents\Syncfusion\EssentialStudio\x.x.x.x\Windows\Pdf.Windows\Samples\2.0\Modify Documents\Overlay Documents

Please let us know if you any question.

Best Regards,
Bhuvana

Loader.
Live Chat Icon For mobile
Up arrow icon