facebooktwittermenuarrow-up

GemBox Support Forum

Append data to existing PDF page

Hello,

I am a licensed user of GemBox.Bundle Professional 2.7 . and I need to append a pdf I created to an existing PDF page.

How can I accomplish that?

Thanks
Angel Bermudez
The General Insurance

Hi Angel,

Please download the AddContent.zip project and take the GemBoxPdfExtensions.cs file within.
It defines an AddContent extension method that can append (or prepend) one PDF page into another.

Here is a small example how you can use that extension method:

using (var document1 = PdfDocument.Load("input1.pdf"))
using (var document2 = PdfDocument.Load("input2.pdf"))
{
    var page1 = document1.Pages[0];
    var page2 = document2.Pages[0];
    page1.AddContent(page2);

    document1.Save("output.pdf");
}

Regards,
Mario