Guide
How to append a page to a PDF in C#
Call AppendPageAsync(...) to add a page to the end of the document, then write content to that
returned page.
Appending is the simplest page-editing path when the new content belongs at the end of the PDF.
Append a page and save the result
The new page is appended at the end and returned so you can use it immediately.
using ZingPDF;
using ZingPDF.Syntax.CommonDataStructures;
using var pdf = Pdf.Load(File.OpenRead("existing.pdf"));
var page = await pdf.AppendPageAsync(options =>
{
options.MediaBox = Rectangle.FromDimensions(595, 842);
});
await pdf.SaveAsync(File.Create("page-appended.pdf"));
Set the page size before you start writing to it
If the new page should match A4, Letter, or a custom size, pass that through the page creation options when you append it.
That is usually cleaner than appending first and then treating page geometry as a separate concern.
The returned page is ready for content APIs
AppendPageAsync(...) returns the newly created page, so you can add text, images, or other
page content before the final save.
Append when the page belongs at the end
If the new page needs to land in the middle of the document, use InsertPageAsync(...)
instead. Append is the right choice when page order is simple.
Need more than one kind of page edit?
The page-management guide covers append, insert, and delete together.