Get and set document information in C# and VB.NET

With GemBox.Pdf, you can get and set PDF document information (document properties) in your C# or VB.NET application.

The following example demonstrates how to set document properties of an existing PDF document.

Screenshot
PDF Library for C# / VB.NET Screenshot

See the full code below, use Run Example to execute.

Upload your file(Drag files here)

Download an input file

using System;
using System.Text;
using GemBox.Pdf;
using GemBox.Pdf.Content;

class Sample
{
    [STAThread]
    static void Main(string[] args)
    {
        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        PdfDocument document = PdfDocument.Load("LoremIpsum.pdf");

        // Get document information.
        PdfDocumentInformation info = document.Info;

        // Modify document information.
        info.Title = "Document Information Example";
        info.Author = "GemBox.Pdf";
        info.Subject = "Introduction to GemBox.Pdf";
        info.Keywords = "GemBox, Pdf, Examples";

        document.Save("Document Information.pdf");
        document.Close();
    }
}
Imports System.Text
Imports GemBox.Pdf
Imports GemBox.Pdf.Content

Module Samples

    Sub Main()

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

        Dim document As PdfDocument = PdfDocument.Load("LoremIpsum.pdf")

        ' Get document information.
        Dim info As PdfDocumentInformation = document.Info

        ' Modify document information.
        info.Title = "Document Information Example"
        info.Author = "GemBox.Pdf"
        info.Subject = "Introduction to GemBox.Pdf"
        info.Keywords = "GemBox, Pdf, Examples"

        document.Save("Document Information.pdf")
        document.Close()

    End Sub

End Module