GetMetadata

Parser.GetMetadata method

Extracts metadata from the document.

public IEnumerable<MetadataItem> GetMetadata()

Return Value

A collection of metadata items; null if metadata extraction isn’t supported.

Remarks

Learn more:

Examples

The following example shows how to extract metadata from a document:

// Create an instance of Parser class
using(Parser parser = new Parser(filePath))
{
    // Extract metadata from the document
    IEnumerable<MetadataItem> metadata = parser.GetMetadata();
    // Check if metadata extraction is supported
    if(metadata == null)
    {
        Console.WriteLine("Metatada extraction isn't supported");
    }
 
    // Iterate over metadata items
    foreach(MetadataItem item in metadata)
    {
        // Print an item name and value
        Console.WriteLine(string.Format("{0}: {1}", item.Name, item.Value));
    }
}

See Also