Draw one PDF page on another PDF page.

Code samples for VintaSoft PDF .NET Plug-in. Here you can request a code sample.

Moderator: Alex

Post Reply
Alex
Site Admin
Posts: 1462
Joined: Thu Jul 10, 2008 2:21 pm

Draw one PDF page on another PDF page.

Post by Alex » Mon Apr 06, 2015 4:58 pm

Here is an example that shows how to draw one PDF page on another PDF page:

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);
}

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest