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
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,
UPDATE 23-05-2022:
The latest version of GemBox.Pdf includes the PdfPage.ConvertToForm method which can be used to append the content from one PDF page to another.
Here is a small example of how you can use it:
var form = document2.Pages[0].ConvertToForm(document1);
var group = document1.Pages[0].Content.Elements.AddGroup();
group.Elements.AddForm(form);
document1.Save("output.pdf");
ORIGINAL:
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