Edit PDF files using incremental updates in C# and VB.NET

GemBox.Pdf allows users to modify PDF documents. Users should not have to wait for an entire file (which can contain hundreds of pages or more) to be rewritten each time modifications to the document are saved.

The PDF format allows modifications to be appended to a file, leaving the original data intact. The addendum appended when a file is incrementally updated contains only those objects that were actually added or modified.

Because the original contents of the document are still present in the file, it is possible to undo saved changes by deleting one or more addenda. The ability to recover the exact contents of an original document is critical when digital signatures have been applied and subsequently need to be verified.

For more information about PDF incremental update in GemBox.Pdf, see File Structure help page.

The following example demonstrates how to load a PDF document, add an empty page, and save the changes using the incremental update capability.

Screenshot of PDF file incrementally updated with GemBox.Pdf library
PDF file incrementally updated with GemBox.Pdf C#/VB.NET library
Upload your file (Drag file here)
using GemBox.Pdf;

class Program
{
    static void Main()
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        // Load a PDF document from a file.
        using (var document = PdfDocument.Load("%InputFileName%"))
        {
            // Add a new empty page.
            document.Pages.Add();

            // Save all the changes made to the current PDF document using an incremental update.
            document.Save();
        }
    }
}
Imports GemBox.Pdf

Module Program

    Sub Main()

        ' If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY")

        ' Load a PDF document from a file.
        Using document = PdfDocument.Load("%InputFileName%")

            ' Add a new empty page.
            document.Pages.Add()

            ' Save all the changes made to the current PDF document using an incremental update.
            document.Save()
        End Using
    End Sub
End Module

Check next example or download examples from GitHub.