Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfLogicalPage

OfficeIMO.Pdf

Namespace
OfficeIMO.Pdf
Assembly
OfficeIMO.Pdf
Source revision
be6c300e4ab1 with working tree changes
Modifiers
sealed

Logical view of a single PDF page.

Inheritance

  • object
  • PdfLogicalPage

Remarks

Native page coordinates use default user-space units: one unit is /UserUnit physical points (1/72 inch each), defaulting to 1. Local text/font and matrix values retain their native coordinate spaces. Explicit visual projections use their documented coordinates.

Usage

Explore 9 API references to this type

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

Accepted by parameters 5

Methods

public IReadOnlyList<IPdfLogicalElement> GetElements(PdfLogicalElementKind kind) #

Returns logical page elements of the requested kind.

Parameters

kind OfficeIMO.Pdf.PdfLogicalElementKind required

Returns

IReadOnlyList<IPdfLogicalElement>
public string? GetMarkupText(PdfAnnotation annotation, CancellationToken cancellationToken = default) #

Returns the page text covered by a Highlight, Underline, StrikeOut or Squiggly annotation from this page's PdfLogicalPage.Annotations. Text elements whose centers lie inside the annotation's /QuadPoints (or /Rect when it has no usable quad points) are joined in extraction order with the same word and line separators as PdfPageInteractionMap.GetSelectedText. Invisible OCR text layers count as covered text; runs whose font encoding cannot be mapped to Unicode are left out instead of failing.

Parameters

annotation OfficeIMO.Pdf.PdfAnnotation required
cancellationToken System.Threading.CancellationToken = default optional

Returns

string? The covered text, or null when the annotation is not a text-markup annotation of this page or covers no text.
public bool HasElementKind(PdfLogicalElementKind kind) #

True when at least one logical element of the requested kind is present on this page.

Parameters

kind OfficeIMO.Pdf.PdfLogicalElementKind required

Returns

bool
public PdfSelectionQuad MapUserSpaceRectangleToVisual(double left, double bottom, double right, double top) #

Converts a PDF default user-space rectangle into top-left visual page coordinates, accounting for the effective crop box, inherited rotation, and user-unit scale.

Parameters

left double required
bottom double required
right double required
top double required
public PdfPagePoint MapVisualPointToUserSpace(double x, double y) #

Converts a point from top-left visual page coordinates into PDF default user-space coordinates. This accounts for the effective crop box origin and inherited page rotation.

Parameters

x double required
y double required
public PdfPageRectangle MapVisualRectangleToUserSpace(double left, double top, double right, double bottom) #

Converts a top-left visual page rectangle into PDF default user-space coordinates. This accounts for the effective crop box origin and inherited page rotation.

Parameters

left double required
top double required
right double required
bottom double required

Properties

public int PageNumber { get; } #

One-based source page number.

public double Width { get; } #

Page width in PDF points.

public double Height { get; } #

Page height in PDF points.

public int RotationDegrees { get; } #

Inherited page rotation normalized to 0, 90, 180, or 270.

public PdfPageGeometry Geometry { get; } #

Page boundary boxes and page-level presentation metadata.

public PdfPageBox? MediaBox { get; } #

Inherited /MediaBox boundary, when readable.

public PdfPageBox? CropBox { get; } #

Inherited /CropBox boundary, when readable.

public PdfPageBox? BleedBox { get; } #

Inherited /BleedBox boundary, when readable.

public PdfPageBox? TrimBox { get; } #

Inherited /TrimBox boundary, when readable.

public PdfPageBox? ArtBox { get; } #

Inherited /ArtBox boundary, when readable.

public double? UserUnit { get; } #

Inherited page user-unit scale from /UserUnit, when present and positive.

public string? TabOrder { get; } #

Page tab order from /Tabs, when present.

public double? DurationSeconds { get; } #

Page display duration from /Dur, in seconds, when present.

public PdfPageTransition? Transition { get; } #

Page transition dictionary from /Trans, when present and readable.

public bool HasPageMetadata { get; } #

True when page-level /Metadata was present.

public bool HasPieceInfo { get; } #

True when page-level /PieceInfo was present.

public IReadOnlyList<IPdfLogicalElement> Elements { get; } #

Logical elements in extraction order.

public PdfUnderstandingPageResult Analysis { get; } #

Bounded semantic-stage artifacts, reading-order evidence, classifications, and provenance for this page.

public IReadOnlyDictionary<PdfLogicalElementKind, IReadOnlyList<IPdfLogicalElement>> ElementsByKind { get; } #

Logical page elements grouped by element kind.

public IReadOnlyList<PdfLogicalTextBlock> TextBlocks { get; } #

Line-level text blocks extracted from positioned text spans.

public IReadOnlyList<PdfLogicalHeading> Headings { get; } #

Heading lines inferred from fused font, geometry, outline, and tagged-PDF evidence.

public IReadOnlyList<PdfLogicalTextBlock> Headers { get; } #

Page-header text identified by the canonical semantic pipeline.

public IReadOnlyList<PdfLogicalTextBlock> Footers { get; } #

Page-footer text identified by the canonical semantic pipeline.

public IReadOnlyList<PdfLogicalTextBlock> Captions { get; } #

Caption text identified by the canonical semantic pipeline.

public IReadOnlyList<PdfLogicalTextBlock> Footnotes { get; } #

Footnote text identified by the canonical semantic pipeline.

public IReadOnlyList<PdfLogicalParagraph> Paragraphs { get; } #

Heuristic paragraph groups built from non-table, non-list text lines.

public IReadOnlyList<PdfLogicalListItem> ListItems { get; } #

Detected bullet and numbered list items with marker and level hints.

public IReadOnlyList<PdfLogicalTable> Tables { get; } #

Detected table-like regions.

public int VectorPrimitiveCount { get; } #

Number of visible vector drawing primitives recovered from the source page.

public bool HasVisualPrimitiveCounts { get; } #

True when optional visual primitive inspection ran. When false, a zero primitive count describes an omitted projection and does not establish the absence of source graphics.

public bool IncludesImages { get; } #

True when the source image projection was requested. When false, an empty PdfLogicalPage.Images collection does not establish the absence of source images.

public bool IncludesFormWidgets { get; } #

True when the source form-widget projection was requested. When false, an empty PdfLogicalPage.FormWidgets collection does not establish the absence of source widgets.

public IReadOnlyList<PdfLogicalImage> Images { get; } #

Image XObjects referenced by the page.

public IReadOnlyList<PdfAnnotation> Annotations { get; } #

Generic page annotations read from the page, including any primary, additional, or chained actions.

public int AnnotationCount { get; } #

Number of generic page annotations read from the page.

public bool HasAnnotations { get; } #

True when the page has at least one generic annotation.

public IReadOnlyList<PdfLinkAnnotation> LinkAnnotations { get; } #

Simple link annotations read from the page.

public IReadOnlyList<PdfLogicalFormWidget> FormWidgets { get; } #

AcroForm widget annotations placed on this page.

public IReadOnlyList<PdfPageAction> PageActions { get; } #

Page-level additional actions attached to the source page dictionary.

public int PageActionCount { get; } #

Number of page-level additional actions attached to the source page dictionary.

public bool HasPageActions { get; } #

True when the source page dictionary has page-level additional actions.

public bool HasOptionalContentUsage { get; } #

True when the page content, an invoked resource, or a page annotation uses optional-content membership.

Extension Methods

public static string ExtractMarkdown(PdfLogicalPage page, PdfLogicalMarkdownOptions? options = null) #

Renders a logical PDF page as Markdown using headings, paragraphs, lists, tables, and optional annotations from the existing logical model.

Parameters

page OfficeIMO.Pdf.PdfLogicalPage required
options OfficeIMO.Pdf.PdfLogicalMarkdownOptions? = null optional

Returns

string