XpsPage
OfficeIMO.Xps
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.
Returned or exposed by 6
- Method XpsDocument.AddPage
- Property XpsDocument.Pages
- Method XpsFixedDocument.AddPage
- Method XpsFixedDocument.InsertPage
- Property XpsFixedDocument.Pages
- Property XpsVisual.Page
Accepted by parameters 1
- Method XpsFixedDocument.InsertPage
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
- x double
- y double
- width double
- height double
Returns
XpsVisualpublic 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
- fill string? = "#FF000000"
- stroke string? = null
- strokeThickness double = 1
Returns
XpsVisualpublic 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
- fontUri string
- fontSize double
- originX double
- originY double
- fill string = "#FF000000"
Returns
XpsVisualpublic string ExtractText() #Returns page-element UnicodeString values in markup order, excluding resources and brush visuals. Paragraphs and reading order are not inferred.
Returns
stringpublic XElement GetMarkup() #A detached copy of native page markup. Use ReplaceMarkup to apply edits.
Returns
XElementpublic XElement? GetStoryFragmentsMarkup(CancellationToken cancellationToken = default) #Returns detached relationship-owned StoryFragments markup, or null when the page has none.
Parameters
- cancellationToken System.Threading.CancellationToken = default
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
Returns
XpsPageStructurepublic void ReplaceMarkup(XElement markup) #Replaces page markup in the same dialect; native unsupported features remain available for preservation.
Parameters
- markup System.Xml.Linq.XElement
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
- storyFragments System.Xml.Linq.XElement
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
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
Returns
OfficeDrawingpublic OfficeImageExportResult ToImage(OfficeImageExportFormat format, OfficeImageExportOptions? options = null, CancellationToken cancellationToken = default) #Renders using the existing managed drawing codecs.
Parameters
- format OfficeIMO.Drawing.OfficeImageExportFormat
- options OfficeIMO.Drawing.OfficeImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeImageExportResultpublic 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
- cancellationToken System.Threading.CancellationToken = default
Returns
XpsSvgResult