Adding Metadata to PDF in C#

Add custom metadata properties to a wide range of business documents, images, audio & video file formats using GroupDocs.Metadata for .NET API.

Download Free Trial

About GroupDocs.Metadata for .NET API

GroupDocs.Metadata for .NET offers an advanced set of metadata management and manipulation features, allowing .NET programmers to easily view, edit, delete, find, compare, swap and export metadata information from images and document formats without using any external software. Add metadata details to PDF, Microsoft Word, Excel, PowerPoint, Outlook, OneNote, Visio, Project, AutoCAD, Archive and Multimedia file formats with additional support to perform metadata operations on any .NET-based applications with true flexibility.

Steps for Adding PDF Metadata in C#

GroupDocs.Metadata makes it easy for .NET developers to add metadata details to PDF files from within their applications by implementing a few easy steps.

  • Load PDF with an instance of Metadata class.
  • Use Metadata.AddProperties method to add the properties.
  • Use a predicate to find desired metadata properties.
  • Save the changes back in PDF format.

System Requirements

GroupDocs.Metadata for .NET APIs are supported on all major platforms and operating systems. Before executing the code below, please make sure that you have the following prerequisites installled on your system.

  • Operating Systems: Microsoft Windows, Linux, MacOS
  • Development Environments: Visual Studio, Xamarin, MonoDevelop
  • Frameworks: .NET Framework, .NET Standard, .NET Core, Mono
  • Download the latest version of GroupDocs.Metadata for .NET from Nuget

// load the file in an instance of Metadata class
using (var metadata = new GroupDocs.Metadata.Metadata("input.pdf"))
{
	// add a property containing the content author
	var affected = metadata.AddProperties(p => p.Tags.Contains(
		GroupDocs.Metadata.Tagging.Tags.Person.Creator), new GroupDocs.Metadata.Common.PropertyValue("test content author")
		);
	Console.WriteLine("Affected properties: {0}", affected);
	metadata.Save("output.pdf");
}

Live Demos to Add Metadata

Add metadata information to PDF file right now by visiting GroupDocs.Metadata Live Demos website.
The live demo has the following benefits

No need to download GroupDocs API.

No need to write any code

Just upload the source file to have an instant display.

Get the download link to save the file on your machine.

About PDF File Format

Portable Document Format (PDF) is a type of document created by Adobe back in 1990s. The purpose of this file format was to introduce a standard for representation of documents and other reference material in a format that is independent of application software, hardware as well as Operating System. PDF files can be opened in Adobe Acrobat Reader/Writer as well in most modern browsers like Chrome, Safari, Firefox via extensions/plug-ins. Most of the commercially available software suites also offer conversion of their documents to PDF file format without the requirement of any additional software component. Thus, PDF file format has full capability to contain information like text, images, hyperlinks, form-fields, rich media, digital signatures, attachments, metadata, Geospatial features and 3D objects in it that can become as part of source document.

Read More

Adding Metadata Properties To Other File Formats

Multi format documents and images metadata addition API for .NET. Add metadata to some of the popular file formats as stated below.

Add Metadata to PDF

(Adobe Portable Document Format)

Add Metadata to DOC

(Microsoft Word Document)

Add Metadata to DOCM

(Microsoft Word Macro-Enabled Document)

Add Metadata to DOCX

(Microsoft Word Open XML Document)

Add Metadata to DOT

(Microsoft Word Document Template)

Add Metadata to DOTX

(Word Open XML Document Template)

Add Metadata to XLS

(Microsoft Excel Binary File Format)

Add Metadata to XLSX

(Microsoft Excel Open XML Spreadsheet)

Add Metadata to XLSM

(Microsoft Excel Macro-Enabled Spreadsheet)

Add Metadata to XLTM

(OOXML Macro Enabled Workbook Template)

Add Metadata to PPT

(PowerPoint Presentation)

Add Metadata to PPS

(Microsoft PowerPoint Slide Show)

Add Metadata to PPTX

(PowerPoint Open XML Presentation)

Add Metadata to PPSX

(PowerPoint Open XML Slide Show)

Add Metadata to POTX

(Microsoft PowerPoint Open XML Template)

Add Metadata to POTM

(Microsoft PowerPoint Template)

Add Metadata to PPTM

(Microsoft PowerPoint Presentation)

Add Metadata to PPSM

(Microsoft PowerPoint Slide Show)

Add Metadata to ODS

(Open Document Spreadsheet)

Add Metadata to ODT

(Open Document Text)

Add Metadata to TIFF

(Tagged Image File Format)

Add Metadata to PNG

(Portable Network Graphic)

Add Metadata to GIF

(Graphical Interchange Format File)

Add Metadata to BMP

(Bitmap File Format)

Add Metadata to JP2

(JPEG 2000 Core Image File)

Add Metadata to WEBP

(Raster Web Image File Format)

Add Metadata to PSD

(Adobe Photoshop Document)

Add Metadata to WMF

(Windows Metafile)

Add Metadata to EMF

(Enhanced Metafile Format)

Add Metadata to MPP

(Microsoft Project Document)

Add Metadata to MSG

(Microsoft Outlook E-mail Message)

Add Metadata to EML

(E-mail Message)

Add Metadata to DWG

(Autodesk Design Data Formats)

Add Metadata to DXF

(AutoCAD Drawing Interchange)

Add Metadata to ONE

(Microsoft OneNote)

Add Metadata to MP3

(MPEG Audio Layer III)

Add Metadata to WAV

(Waveform Audio File Format)

Add Metadata to DICOM

(Digital Imaging & Comm in Medicine)

Add Metadata to AVI

(Audio Video Interleave File)

Add Metadata to VSD

(Microsoft Visio 2003-2010 Drawing)

Add Metadata to VSDX

(Microsoft Visio Drawing)

Add Metadata to VSS

(Microsoft Visio 2003-2010 Stencil)

Add Metadata to VDX

(Microsoft Visio 2003-2010 XML Drawing)

Add Metadata to VSX

(Microsoft Visio 2003-2010 XML Stencil)

Add Metadata to ZIP

(Archive File Format)

Add Metadata to EPUB

(Digital E-Book File Format)