How to Edit PDF Properties in C#

This article walks you through how to edit PDF properties in C#. It has the IDE settings, a list of steps to be followed for developing the application, and a runnable sample code to edit metadata of PDF in C#. You will learn about different properties that can be edited and other possible operations with the metadata.

Steps to Modify PDF Metadata in C#

  1. Set the IDE to use Aspose.PDF for .NET to edit metadata
  2. Load the target PDF file with metadata using the Document object
  3. Fetch the PDF metadata using the DocumentInfo object
  4. Update the metadata as per the requirements
  5. Save the resultant PDF file with updated metadata

These steps lay out the process to change PDF properties in C#. In the beginning, the source PDF file is loaded from a file or stream using the password if required, followed by accessing the document properties using the DocumentInfo class object. It has multiple properties that can be set by providing data in an appropriate format.

Code to Edit PDF Meta in C#

This code reveals how to change metadata of PDF in C#. The DocumentInfo object is populated by providing the loaded PDF document object. You can not only modify the properties using the DocumentInfo object but may add or clear the properties as well.

This article has shown us the way to develop a PDF metadata editor in C#. If you are curious about learning the process to edit the PDF background, refer to the article on how to edit PDF background color using C#.

 English