Examples

Adding New Content to Existing Page in PDF

Adding a new page or new content to an existing page in PDF using DynamicPDF Core Suite is simple and easy.

How to Add New Content to Page in C#

The following steps and sample code illustrate adding new content to an existing page in PDF using DynamicPDF Core Suite.

Steps for Adding new Content to an Existing PDF

  1. Create a MergeDocument object.
  2. Create a Page object pointing to the specific page in the MergeDocument instance.
  3. Add desired page element to the Page instance.
  4. Save the PDF document.

Sample Code - C#

MergeDocument document = new MergeDocument( pdfFilePath );
Page page = document.Pages[0];
page.Elements.Add( new Label( "New Content", 0, 0, 512, 12 ) );
document.Draw(@"Output.pdf");

How to Add New Page to PDF in C#

The following steps and sample code illustrate adding a new page to a PDF using DynamicPDF Core Suite.

Steps for Adding a New Page

  1. Create a MergeDocument object.
  2. Create a Page object and set its PageSize and PageOrientation parameters.
  3. Add a Label instance to the Page instance.
  4. Add Page instance to the Document object instance.
  5. Call the Append method on the Document object.
  6. Save the PDF document.

Sample Code - C#

MergeDocument document = new MergeDocument();
Page page = new Page( PageSize.Letter, PageOrientation.Portrait );
page.Elements.Add( new Label( "Cover Page", 0, 0, 512, 12 ) );
document.Pages.Add( page );
document.Append(@"DocumentA.pdf");
document.Draw(@"Output.pdf");

GitHub Project

Clone or view the example project at GitHub. This example code is contained in the Examples/AddNewContentExample.cs file.

Clone or View Example Project on GitHub

Getting Started

NuGet Package

The easiest way to install DynamicPDF Core Suite is by using the Visual Studio Package Manager. DynamicPDF Core Suite is also available on NuGet and is part of the ceTe.DynamicPDF.CoreSuite.NETpackage.

NuGet Package ID: ceTe.DynamicPDF.CoreSuite.NET

DynamicPDF Core Suite Information

More information on merging using DynamicPDF Core Suite can be found at the following web page.

Available on Other Platforms

The DynamicPDF Core Suite is also available for Java and COM/ActiveX. Refer to the respective product pages for more details.

Why Choose DynamicPDF?

  • Transparent Pricing
  • Lots of Features
  • Easy to Use
  • Great Support
  • Efficient Performance
  • Product Maturity (Over 22 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

We’re Not The Only Ones That Think We’re Great!