Accusoft.PdfXpress5.Net
Create & Modify Document Metadata
See Also Send Feedback
PDF Xpress 5 for .NET - User Guide > How To > Modify PDF Document Content > Create & Modify Document Metadata

Glossary Item Box

PDF Xpress™ supports creating, reading, and modifying general information about a PDF document, called Metadata. Metadata is stored in the document information dictionary and can include information such as the document's author, title, and keywords.

To read Metadata for an open PDF document, access the DocumentMetadata of the document and do one of the following:

To add or modify Metadata for an open PDF document, access the DocumentMetadata of the document and do one of the following:

PDF Xpress does not permit direct modification of CreationDate or ModDate Metadata.

Create Document Metadata

C# Example Copy Code
// This code demonstrates how to create document Metadata 
Accusoft.PdfXpressSdk.PdfXpress pdfXpress1 = null;
Accusoft.PdfXpressSdk.Document document = null;
Accusoft.PdfXpressSdk.DocumentMetadata data = null;
try
{
     pdfXpress1 = new PdfXpress();
     pdfXpress1.Initialize();
     document = new Document(pdfXpress1, "C:\ mynewfile.pdf");
     data = document.DocumentMetadata;             
     data. SetItemProperty ( "Author", "New Author");
     data.SetItemProperty("CreationDate","031508");
     data.SetItemProperty("Creator", "NewCreator");
     data.SetItemProperty("ModificationDate","031608");
}
catch (System.Exception ex)
{
}
finally
{
     if ( null != data) data.Dispose( );
     if ( null != document ) document.Dispose( );
     if ( null != pdfXpress1 ) pdfXpress1.Dispose( );           
}

Modify Document Metadata

C# Example Copy Code
// This code demonstrates how to modify document Metadata 
Accusoft.PdfXpressSdk.PdfXpress pdfXpress1 = null;
Accusoft.PdfXpressSdk.Document document =null;
Accusoft.PdfXpressSdk. DocumentMetadata data = null;
try
{
     pdfXpress1 = new PdfXpress();
     pdfXpress1.Initialize();
     document = new Document(pdfXpress1, "C:\ mynewfile.pdf");
     data = document.DocumentMetadata;
     data. Author = "New Author";
}
catch (System.Exception ex)
{
}
finally
{        
     if ( null ! = data)data.Dispose();
     if ( null != document ) document.Dispose( );
     if ( null != pdfXpress1 ) pdfXpress1.Dispose( );           
}

 

See Also

©2012. Accusoft Corporation. All Rights Reserved.