IronPDF How-Tos Set and Edit PDF Metadata How to Set and Edit PDF Metadata Jordi Bardia Updated:July 28, 2025 Metadata in a PDF document refers to descriptive information about the document itself. Metadata in a PDF includes information such as the document's title, author, subject, keywords, creation date, modification date, and more. Metadata allows for PDFs to be better indexed and searched in databases. It also increases their searchability on the internet. Get started with IronPDF Start using IronPDF in your project today with a free trial. First Step: Start for Free How to Set and Edit PDF Metadata Download the IronPDF C# library for PDF metadata editing Load an existing PDF or render a new one Access the MetaData property to set and edit the PDF metadata Utilize the metadata dictionary for effective metadata processing Add, edit, or remove custom PDF metadata properties Set and Edit Metadata Example When using IronPDF, setting and editing the generic metadata fields in PDFs is a straightforward process. You can easily access the MetaData property to modify the available metadata fields. :path=/static-assets/pdf/content-code-examples/how-to/metadata-set-edit.cs using IronPdf; using System; ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Metadata</h1>"); // Access the MetaData class and set the pre-defined metadata properties. pdf.MetaData.Author = "Iron Software"; pdf.MetaData.CreationDate = DateTime.Today; pdf.MetaData.Creator = "IronPDF"; pdf.MetaData.Keywords = "ironsoftware,ironpdf,pdf"; pdf.MetaData.ModifiedDate = DateTime.Now; pdf.MetaData.Producer = "IronPDF"; pdf.MetaData.Subject = "Metadata Tutorial"; pdf.MetaData.Title = "IronPDF Metadata Tutorial"; pdf.SaveAs("pdf-with-metadata.pdf"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Output PDF To view the document metadata, click on the three vertical dots and access the Document properties. Set and Retrieve Metadata Dictionary The GetMetaDataDictionary method allows you to retrieve the existing metadata dictionary and access the metadata information stored within the document. The SetMetaDataDictionary method provides an effective way to rewrite the metadata dictionary. If a key is not present in the generic metadata fields, it will be considered a custom metadata property. :path=/static-assets/pdf/content-code-examples/how-to/metadata-set-and-get-metadata-dictionary.cs using IronPdf; using System.Collections.Generic; ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Metadata</h1>"); Dictionary<string, string> newMetadata = new Dictionary<string, string>(); newMetadata.Add("Title", "How to article"); newMetadata.Add("Author", "IronPDF"); // Set metadata dictionary pdf.MetaData.SetMetaDataDictionary(newMetadata); // Retreive metadata dictionary Dictionary<string, string> metadataProperties = pdf.MetaData.GetMetaDataDictionary(); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Output PDF To view the document metadata, click on the three vertical dots and access the Document properties. Add, Edit, and Remove Custom Metadata Example In addition to the standard metadata of a PDF document, you can include custom metadata properties. These custom properties are often not visible in PDF viewer software, as they typically only display the generic metadata and may not retrieve all existing metadata properties. Add and Edit Custom Metadata To add custom metadata, simply access the CustomProperties property and invoke the Add method. Editing custom metadata requires passing the key value to the CustomProperties property and reassigning its value. :path=/static-assets/pdf/content-code-examples/how-to/metadata-custom-properties.cs using IronPdf; using IronPdf.MetaData; ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Metadata</h1>"); PdfCustomMetadataProperties customProperties = pdf.MetaData.CustomProperties; // Add custom property customProperties.Add("foo", "bar"); // Key: foo, Value: bar // Edit custom property customProperties["foo"] = "baz"; IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Remove Custom Metadata There are two ways to remove custom metadata from a PDF document. You can utilize the RemoveMetaDataKey method, accessible through the Metadata property, or use the Remove method from the CustomProperties property. :path=/static-assets/pdf/content-code-examples/how-to/metadata-remove-custom-properties.cs using IronPdf; ChromePdfRenderer renderer = new ChromePdfRenderer(); PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Metadata</h1>"); // Add custom property to be deleted pdf.MetaData.CustomProperties.Add("willBeDeleted", "value"); // Remove custom property _ two ways pdf.MetaData.RemoveMetaDataKey("willBeDeleted"); pdf.MetaData.CustomProperties.Remove("willBeDeleted"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Ready to see what else you can do? Check out our tutorial page here: Sign and Secure PDFs Frequently Asked Questions What is PDF metadata and why is it important? PDF metadata consists of information such as the document's title, author, subject, keywords, and dates of creation and modification. This metadata enhances the searchability and indexing of PDFs in databases and on the internet, making them easier to find and manage. How can I set PDF metadata using C#? You can set PDF metadata using IronPDF by first downloading the library, loading an existing PDF, and accessing the MetaData property to modify the metadata fields such as title, author, and keywords. How do I retrieve and modify the metadata dictionary in a PDF? To retrieve and modify the metadata dictionary in a PDF, use IronPDF's GetMetaDataDictionary method to access the current metadata. Modify the dictionary as needed, and then apply changes using the SetMetaDataDictionary method. Can custom metadata be added to a PDF document? Yes, custom metadata can be added to a PDF using IronPDF by accessing the CustomProperties property and using the Add method to insert custom key-value pairs. How do I remove specific custom metadata from a PDF? To remove specific custom metadata from a PDF, use the RemoveMetaDataKey method through the MetaData property, or apply the Remove method on the CustomProperties property in IronPDF. What are the steps to edit PDF metadata with IronPDF? To edit PDF metadata with IronPDF, download the library, load your PDF, access the MetaData property to change metadata fields, and then save the document with updated metadata. Is it possible to view custom metadata in most PDF viewers? Custom metadata is generally not visible in most PDF viewers, as they typically display only standard metadata fields such as title and author. How do I start using IronPDF for metadata editing in PDFs? To start using IronPDF for metadata editing, download the library from NuGet, load your PDF document in C#, and use the provided methods to access and modify the metadata properties. What method allows the addition of custom metadata properties in IronPDF? In IronPDF, custom metadata properties can be added using the CustomProperties property, where you can use the Add method to insert custom metadata. Are there any limitations on viewing metadata in PDF viewers? Yes, standard PDF viewers usually only display generic metadata fields, and custom metadata might not be visible without specialized tools like IronPDF. Jordi Bardia Chat with engineering team now Software Engineer Jordi is most proficient in Python, C# and C++, when he isn’t leveraging his skills at Iron Software; he’s game programming. Sharing responsibilities for product testing, product development and research, Jordi adds immense value to continual product improvement. The varied experience keeps him challenged and engaged, and he ...Read More Ready to Get Started? Free NuGet Download Total downloads: 15,030,178 View Licenses