InspectionPackage

PdfRootPackage.InspectionPackage property

Gets a metadata package containing inspection results for the document. The package contains information about document parts that can be considered as metadata in some cases.

public PdfInspectionPackage InspectionPackage { get; }

Property Value

A metadata package containing inspection results for the document.

Remarks

Learn more

Examples

This example demonstrates how to inspect a PDF document.

using (Metadata metadata = new Metadata(Constants.SignedPdf))
{
    var root = metadata.GetRootPackage<PdfRootPackage>();

    if (root.InspectionPackage.Annotations != null)
    {
        foreach (var annotation in root.InspectionPackage.Annotations)
        {
            Console.WriteLine(annotation.Name);
            Console.WriteLine(annotation.Text);
            Console.WriteLine(annotation.PageNumber);
        }
    }

    if (root.InspectionPackage.Attachments != null)
    {
        foreach (var attachment in root.InspectionPackage.Attachments)
        {
            Console.WriteLine(attachment.Name);
            Console.WriteLine(attachment.MimeType);
            Console.WriteLine(attachment.Description);
        }
    }

    if (root.InspectionPackage.Bookmarks != null)
    {
        foreach (var bookmark in root.InspectionPackage.Bookmarks)
        {
            Console.WriteLine(bookmark.Title);
        }
    }

    if (root.InspectionPackage.DigitalSignatures != null)
    {
        foreach (var signature in root.InspectionPackage.DigitalSignatures)
        {
            Console.WriteLine(signature.CertificateSubject);
            Console.WriteLine(signature.Comments);
            Console.WriteLine(signature.SignTime);

            // ...
        }
    }

    if (root.InspectionPackage.Fields != null)
    {
        foreach (var field in root.InspectionPackage.Fields)
        {
            Console.WriteLine(field.Name);
            Console.WriteLine(field.Value);

            // ...
        }
    }
}

See Also