ParserGetContainer Method
Extracts a container object from the document to work with formats that contain attachments, ZIP archives etc.

Namespace: GroupDocs.Parser
Assembly: GroupDocs.Parser (in GroupDocs.Parser.dll) Version: 20.10.0
Syntax
public IEnumerable<ContainerItem> GetContainer()

Return Value

Type: IEnumerableContainerItem
A collection of container items; null if container extraction isn't supported.
Remarks
Examples

The following example shows how to extract attachments from a container:

C#
// Create an instance of Parser class
using(Parser parser = new Parser(filePath))
{
    // Extract attachments from the container
    IEnumerable<ContainerItem> attachments = parser.GetContainer();
    // Check if container extraction is supported
    if(attachments == null)
    {
        Console.WriteLine("Container extraction isn't supported");
    }

    // Iterate over attachments
    foreach(ContainerItem item in attachments)
    {
        // Print an item name and size
        Console.WriteLine(string.Format("{0}: {1}", item.Name, item.Size));
    }
}
See Also