Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

XpsPage

OfficeIMO.Xps

Namespace
OfficeIMO.Xps
Assembly
OfficeIMO.Xps
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

A fixed page retaining native XML, dimensions, resource references and positioned text.

Inheritance

  • object
  • XpsPage

Usage

Explore 7 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 1

Methods

public XpsVisual AddImage(string imageUri, double x, double y, double width, double height) #

Places an embedded PNG, JPEG, TIFF or supported JPEG XR using an image brush and a rectangular viewport.

Parameters

imageUri string required
x double required
y double required
width double required
height double required

Returns

XpsVisual
public XpsVisual AddPath(string data, string? fill = "#FF000000", string? stroke = null, double strokeThickness = 1) #

Appends native path geometry; paint strings follow the XPS color syntax.

Parameters

data string required
fill string? = "#FF000000" optional
stroke string? = null optional
strokeThickness double = 1 optional

Returns

XpsVisual
public XpsVisual AddText(string text, string fontUri, double fontSize, double originX, double originY, string fill = "#FF000000") #

Appends Unicode glyph text using an embedded font. Origin is the baseline in XPS units.

Parameters

text string required
fontUri string required
fontSize double required
originX double required
originY double required
fill string = "#FF000000" optional

Returns

XpsVisual
public string ExtractText() #

Returns page-element UnicodeString values in markup order, excluding resources and brush visuals. Paragraphs and reading order are not inferred.

Returns

string
public XElement GetMarkup() #

A detached copy of native page markup. Use ReplaceMarkup to apply edits.

Returns

XElement
public XElement? GetStoryFragmentsMarkup(CancellationToken cancellationToken = default) #

Returns detached relationship-owned StoryFragments markup, or null when the page has none.

Parameters

cancellationToken System.Threading.CancellationToken = default optional

Returns

XElement?
public XpsPageStructure ReadContentStructure(CancellationToken cancellationToken = default) #

Reads native paragraph, list, table and figure structure without inferring semantics from placement.

Parameters

cancellationToken System.Threading.CancellationToken = default optional
ReplaceMarkup 2 overloads
public void ReplaceMarkup(XElement markup) #

Replaces page markup in the same dialect; native unsupported features remain available for preservation.

Parameters

markup System.Xml.Linq.XElement required
public void ReplaceMarkup(XElement markup, XElement storyFragments) #

Atomically replaces page and StoryFragments markup, allowing named content and references to be edited together.

Parameters

markup System.Xml.Linq.XElement required
storyFragments System.Xml.Linq.XElement required
public void ReplaceStoryFragmentsMarkup(XElement markup) #

Creates or replaces the page's native StoryFragments part, preserving unrelated relationships and package parts.

Parameters

markup System.Xml.Linq.XElement required
public OfficeDrawing ToDrawing(CancellationToken cancellationToken = default) #

Converts through the shared SVG reader. Any SVG import loss fails rather than silently disappearing.

Parameters

cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeDrawing
public OfficeImageExportResult ToImage(OfficeImageExportFormat format, OfficeImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Renders using the existing managed drawing codecs.

Parameters

format OfficeIMO.Drawing.OfficeImageExportFormat required
options OfficeIMO.Drawing.OfficeImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeImageExportResult
public XpsSvgResult ToSvg(bool allowPartial = false, CancellationToken cancellationToken = default) #

Converts the page to self-contained SVG, with explicit diagnostics for unsupported features.

Parameters

allowPartial bool = false optional
cancellationToken System.Threading.CancellationToken = default optional

Properties

public string PartName { get; } #

Native package part name, without a leading slash.

public double Width { get; } #

Width in 1/96-inch units.

public double Height { get; } #

Height in 1/96-inch units.