Table of Contents

DocumentSummaryInformation Class

Definition

Namespace
Bodu.IO.Compound.PropertySets
Assembly
Bodu.IO.Compound.dll
Package
Bodu.IO.Compound 1.0.0
Source
DocumentSummaryInformation.cs

Provides a strongly-typed view over the document-summary-information property set (\x05DocumentSummaryInformation) of a compound file, including any user-defined custom properties.

public sealed class DocumentSummaryInformation
Inheritance
DocumentSummaryInformation
Inherited Members
Extension Methods

Remarks

The document-summary-information set carries extended document metadata such as the category, company, and slide count, and may include a second, user-defined section whose properties are named by a dictionary. Each property is optional; a property that is absent or of an unexpected type is surfaced as null.

The following example reads the extended metadata and enumerates any user-defined custom properties.
using Bodu.IO.Compound;
using Bodu.IO.Compound.PropertySets;

using CompoundFile file = CompoundFile.OpenRead("report.doc");
if (file.TryGetDocumentSummaryInformation(out DocumentSummaryInformation? info))
{
    Console.WriteLine($"Company:  {info.Company}");
    Console.WriteLine($"Category: {info.Category}");
    foreach (KeyValuePair<string, OlePropertyValue> custom in info.CustomProperties)
        Console.WriteLine($"{custom.Key} = {custom.Value.Value}");
}

Constructors

DocumentSummaryInformation(OlePropertySet)

Initializes a new instance of the DocumentSummaryInformation class over a parsed property set.

public DocumentSummaryInformation(OlePropertySet propertySet)

Parameters

propertySet OlePropertySet

The parsed document-summary-information property set.

Exceptions

ArgumentNullException

Thrown when propertySet is null.

Fields

StreamName

The directory name of the document-summary-information stream, including its leading control prefix.

public const string StreamName = "\u0005DocumentSummaryInformation"

Field Value

string

Properties

Bytes

Gets the document size in bytes.

public int? Bytes { get; }

Property Value

int?

The byte count, or null when absent.

Category

Gets the document category.

public string? Category { get; }

Property Value

string

The category, or null when absent.

Company

Gets the document company.

public string? Company { get; }

Property Value

string

The company, or null when absent.

CustomProperties

Gets the user-defined custom properties, keyed by their human-readable names.

public IReadOnlyDictionary<string, OlePropertyValue> CustomProperties { get; }

Property Value

IReadOnlyDictionary<string, OlePropertyValue>

A dictionary of custom property name to value drawn from the user-defined section; empty when the property set has no user-defined section.

HiddenCount

Gets the hidden-slide count.

public int? HiddenCount { get; }

Property Value

int?

The hidden-slide count, or null when absent.

LineCount

Gets the line count.

public int? LineCount { get; }

Property Value

int?

The line count, or null when absent.

LinksUpToDate

Gets a value indicating whether the document's links are up to date.

public bool? LinksUpToDate { get; }

Property Value

bool?

The links-up-to-date flag, or null when absent.

Manager

Gets the document manager.

public string? Manager { get; }

Property Value

string

The manager, or null when absent.

MultimediaClipCount

Gets the multimedia-clip count.

public int? MultimediaClipCount { get; }

Property Value

int?

The multimedia-clip count, or null when absent.

NoteCount

Gets the note count.

public int? NoteCount { get; }

Property Value

int?

The note count, or null when absent.

ParagraphCount

Gets the paragraph count.

public int? ParagraphCount { get; }

Property Value

int?

The paragraph count, or null when absent.

PresentationTarget

Gets the presentation target format.

public string? PresentationTarget { get; }

Property Value

string

The presentation target, or null when absent.

PropertySet

Gets the underlying parsed property set.

public OlePropertySet PropertySet { get; }

Property Value

OlePropertySet

The document-summary-information OlePropertySet.

ScaleCrop

Gets a value indicating whether the document is scaled to crop.

public bool? ScaleCrop { get; }

Property Value

bool?

The scale-crop flag, or null when absent.

SlideCount

Gets the slide count.

public int? SlideCount { get; }

Property Value

int?

The slide count, or null when absent.

Methods

Read(Stream)

Reads and parses a document-summary-information property set from a stream, consuming it to the end.

public static DocumentSummaryInformation Read(Stream stream)

Parameters

stream Stream

The stream containing the document-summary-information property-set bytes.

Returns

DocumentSummaryInformation

A DocumentSummaryInformation view over the parsed property set.

Exceptions

ArgumentNullException

Thrown when stream is null.

CompoundFileFormatException

Thrown when the data is not a well-formed property set.

Applies to

ProductVersions
.NET8, 10