Code: Select all
public void Test()
{
using (PdfDocument document1 = new PdfDocument("document1.pdf"))
{
using (PdfDocument document2 = new PdfDocument("document2.pdf"))
{
DrawPage(document1.Pages[0], document2.Pages[0], document1.Pages[0].MediaBox);
document1.SaveChanges();
}
}
}
public void DrawPage(PdfPage sourcePage, PdfPage topPage, RectangleF rect)
{
using (PdfGraphics g = sourcePage.GetGraphics())
g.DrawPageAsForm(topPage, rect);
}