API Reference

Class

PdfReadDocument

Namespace OfficeIMO.Pdf
Assembly OfficeIMO.Pdf
Modifiers sealed

Represents a parsed PDF document with access to pages, catalog and metadata. Note: MVP reader supports classic xref tables and simple stream parsing sufficient for OfficeIMO.Pdf output.

Inheritance

  • Object
  • PdfReadDocument

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by

Accepted by parameters

Methods

public IReadOnlyList<PdfExtractedAttachment> ExtractAttachments() #
Returns: IReadOnlyList<PdfExtractedAttachment>

Extracts embedded file attachments from the document catalog.

public IReadOnlyList<PdfExtractedImage> ExtractImages() #
Returns: IReadOnlyList<PdfExtractedImage>

Extracts image XObjects from all pages in page order.

public String ExtractText() #
Returns: String

Extracts fullโ€‘document plain text (pages separated by blank lines).

Open 3 overloads
public static PdfReadDocument Open(Byte[] pdf, PdfReadOptions options = null) #
Returns: PdfReadDocument

Opens a PDF from bytes into the canonical typed object model.

Parameters

pdf System.Byte[] requiredposition: 0
options OfficeIMO.Pdf.PdfReadOptions = null optionalposition: 1
public static PdfReadDocument Open(String path, PdfReadOptions options = null) #
Returns: PdfReadDocument

Opens a PDF from a bounded file snapshot.

Parameters

path System.String requiredposition: 0
options OfficeIMO.Pdf.PdfReadOptions = null optionalposition: 1
public static PdfReadDocument Open(Stream stream, PdfReadOptions options = null) #
Returns: PdfReadDocument

Opens a PDF from a bounded readable stream snapshot.

Parameters

stream System.IO.Stream requiredposition: 0
options OfficeIMO.Pdf.PdfReadOptions = null optionalposition: 1
public PdfRawDocumentView RawStructure(PdfRawStructureOptions options = null) #
Returns: PdfRawDocumentView

Builds a safe, immutable, bounded projection of the active raw object graph.

Parameters

options OfficeIMO.Pdf.PdfRawStructureOptions = null optionalposition: 0

Properties

public IReadOnlyList<PdfAttachmentInfo> Attachments { get; } #

Embedded and associated file attachment metadata discovered from the document catalog.

public IReadOnlyList<PdfReadPage> Pages { get; } #

All page objects discovered in document order.

public PdfMetadata Metadata { get; } #

Document metadata (when present).

public IReadOnlyList<PdfOutlineItem> Outlines { get; } #

Top-level document outline/bookmark entries.

public IReadOnlyList<PdfPageLabel> PageLabels { get; } #

Page-label rules discovered from the document catalog.

public IReadOnlyList<PdfNamedDestination> NamedDestinations { get; } #

Named destinations discovered from the document catalog.

public IReadOnlyList<PdfCatalogAction> CatalogActions { get; } #

Catalog-level actions discovered from supported name trees.

public PdfDocumentOpenAction OpenAction { get; } #

Simple document open action discovered from the document catalog, when supported.

public PdfViewerPreferences ViewerPreferences { get; } #

Simple viewer preference entries discovered from the document catalog, when supported.

public PdfPortfolioInfo Portfolio { get; } #

Document portfolio metadata discovered from the catalog, when present.

public IReadOnlyList<PdfFormField> FormFields { get; } #

Simple AcroForm fields discovered from the document catalog.

public String AcroFormDefaultAppearance { get; } #

AcroForm default appearance string from /DA, when present.

public Nullable<Int32> AcroFormQuadding { get; } #

Raw AcroForm default /Q quadding value, when present.

public Nullable<Boolean> AcroFormNeedAppearances { get; } #

AcroForm NeedAppearances flag, when present.

public Nullable<Int32> AcroFormSignatureFlags { get; } #

Raw AcroForm signature flags from /SigFlags, when present.

public PdfAcroFormXfaInfo AcroFormXfa { get; } #

AcroForm XFA packet metadata when the document catalog exposes /AcroForm /XFA.

public String CatalogPageMode { get; } #

Catalog page mode, for example UseOutlines or FullScreen, when present.

public String CatalogPageLayout { get; } #

Catalog page layout, for example SinglePage or TwoColumnLeft, when present.

public String CatalogVersion { get; } #

Catalog PDF version override, for example 1.7, when present.

public String CatalogLanguage { get; } #

Catalog language tag, for example en-US or pl-PL, when present.

public PdfDocumentSecurityInfo Security { get; } #

Security, signature, and revision markers read from the source PDF bytes.

public PdfRepairReport RepairReport { get; } #

Structural recoveries applied while loading this document.

public PdfOptionalContentProperties OptionalContent { get; } #

Catalog optional-content/layer metadata discovered from /OCProperties.

public IReadOnlyList<PdfOutputIntentInfo> OutputIntents { get; } #

Catalog output intent metadata discovered from /OutputIntents.

public PdfTaggedContentInfo TaggedContent { get; } #

Tagged PDF structure metadata discovered from /MarkInfo and /StructTreeRoot.

public PdfXmpMetadataInfo XmpMetadata { get; } #

Catalog XMP metadata stream discovered from /Metadata.

Fields

public const Int32 MaxXmpMetadataBytes #

Maximum decoded XMP metadata size parsed as XML.

Value: 4000000

Extension Methods

public static IReadOnlyList<OfficeImageExportResult> ExportImages(PdfReadDocument document, OfficeImageExportFormat format, PdfImageExportOptions options = null, PdfPageSelection selection = null, CancellationToken cancellationToken = null) #
Returns: IReadOnlyList<OfficeImageExportResult>

Exports selected loaded PDF pages using the shared five-format result contract.

Parameters

arg1 OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
arg2 OfficeIMO.Drawing.OfficeImageExportFormat requiredposition: 1
arg3 OfficeIMO.Pdf.PdfImageExportOptions = null optionalposition: 2
arg4 OfficeIMO.Pdf.PdfPageSelection = null optionalposition: 3
arg5 System.Threading.CancellationToken = null optionalposition: 4
public static IReadOnlyList<StructuredHeadingPage> ExtractHeadingsByPage(PdfReadDocument doc, PdfTextLayoutOptions options = null) #
Returns: IReadOnlyList<StructuredHeadingPage>

Extracts detected headings grouped by page while preserving heading geometry.

Parameters

doc OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
Source document.
options OfficeIMO.Pdf.PdfTextLayoutOptions = null optionalposition: 1
Optional layout options.
public static IReadOnlyList<StructuredListItemPage> ExtractListItemsByPage(PdfReadDocument doc, PdfTextLayoutOptions options = null) #
Returns: IReadOnlyList<StructuredListItemPage>

Extracts detected list items grouped by page while preserving marker and nesting hints.

Parameters

doc OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
Source document.
options OfficeIMO.Pdf.PdfTextLayoutOptions = null optionalposition: 1
Optional layout options.
public static IReadOnlyList<StructuredParagraphPage> ExtractParagraphsByPage(PdfReadDocument doc, PdfTextLayoutOptions options = null) #
Returns: IReadOnlyList<StructuredParagraphPage>

Extracts detected paragraphs grouped by page while preserving paragraph geometry.

Parameters

doc OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
Source document.
options OfficeIMO.Pdf.PdfTextLayoutOptions = null optionalposition: 1
Optional layout options.
public static ValueTuple<List<String>, List<ValueTuple<String, Int32>>, List<String>, List<String[]>> ExtractStructured(PdfReadDocument doc, PdfTextLayoutOptions options = null) #
Returns: ValueTuple<List<String>, List<ValueTuple<String, Int32>>, List<String>, List<String[]>>

Extracts simple structured content (lines, TOC rows, list items, leader rows) for the whole document.

Parameters

doc OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
Source document.
options OfficeIMO.Pdf.PdfTextLayoutOptions = null optionalposition: 1
Optional layout options.
public static IReadOnlyList<StructuredPage> ExtractStructuredPages(PdfReadDocument doc, PdfTextLayoutOptions options = null) #
Returns: IReadOnlyList<StructuredPage>

Extracts structured content for each page while preserving page boundaries and detailed table geometry.

Parameters

doc OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
Source document.
options OfficeIMO.Pdf.PdfTextLayoutOptions = null optionalposition: 1
Optional layout options.
public static IReadOnlyList<StructuredTablePage> ExtractTablesByPage(PdfReadDocument doc, PdfTextLayoutOptions options = null) #
Returns: IReadOnlyList<StructuredTablePage>

Extracts detected tables grouped by page while preserving table geometry.

Parameters

doc OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
Source document.
options OfficeIMO.Pdf.PdfTextLayoutOptions = null optionalposition: 1
Optional layout options.
public static String ExtractTextWithColumns(PdfReadDocument doc, PdfTextLayoutOptions options = null) #
Returns: String

Extracts text for all pages using simple two-column detection per page, separating pages with a blank line.

Parameters

doc OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
Source document.
options OfficeIMO.Pdf.PdfTextLayoutOptions = null optionalposition: 1
Optional layout options controlling column detection, margins and trimming.

Returns

Concatenated plain text for all pages with inferred reading order.

ToImages 2 overloads
public static PdfDocumentImageExportBuilder ToImages(PdfReadDocument document) #
Returns: PdfDocumentImageExportBuilder

Starts fluent image export for all pages in a loaded PDF document.

Parameters

document OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
public static PdfDocumentImageExportBuilder ToImages(PdfReadDocument document, PdfImageExportOptions options) #
Returns: PdfDocumentImageExportBuilder

Starts fluent image export using a cloned options snapshot.

Parameters

document OfficeIMO.Pdf.PdfReadDocument requiredposition: 0
options OfficeIMO.Pdf.PdfImageExportOptions requiredposition: 1