Class XpsDocument
Namespace: Aspose.Page.XPS
Assembly: Aspose.Page.dll (25.1.2)
Class incapsulating the main entity of XPS document that provides manipulation methods for any XPS element.
public sealed class XpsDocument : Document, IDisposable
Inheritance
object ← Document ← XpsDocument
Implements
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
XpsDocument()
Creates empty XPS document with default page size.
public XpsDocument()
XpsDocument(string)
Opens an existing XPS document located at the path
.
public XpsDocument(string path)
Parameters
path
string
Location of the document.
XpsDocument(string, LoadOptions)
Opens an existing document located at the path
as XPS document.
public XpsDocument(string path, LoadOptions options)
Parameters
path
string
Location of the document.
options
LoadOptions
Document loading options.
XpsDocument(Stream, LoadOptions)
Loads an existing document stored in the stream
as XPS document.
public XpsDocument(Stream stream, LoadOptions options)
Parameters
stream
Stream
Document stream.
options
LoadOptions
Document loading options.
Properties
ActiveDocument
Gets the active document number.
public int ActiveDocument { get; }
Property Value
ActivePage
Gets the active page number within the active document.
public int ActivePage { get; }
Property Value
DocumentCount
Returns the number of documents inside the XPS package.
public int DocumentCount { get; }
Property Value
JobPrintTicket
Returns/sets document’s job print ticket
public JobPrintTicket JobPrintTicket { get; set; }
Property Value
Page
Returns an Aspose.Page.XPS.XpsModel.XpsPage instance for active page.
public XpsPage Page { get; }
Property Value
PageCount
Returns the number of pages in the active document.
public int PageCount { get; }
Property Value
TotalPageCount
Returns total number of pages in all documents inside XPS document.
public int TotalPageCount { get; }
Property Value
Utils
Gets the object that provides utilities beyond the formal XPS manipulation API.
public DocumentUtils Utils { get; }
Property Value
Methods
Add<t>(T)
Adds a content element (Canvas, Path, or Glyphs).
public T Add<t>(T element) where T : XpsContentElement
Parameters
element
T
Element to be added.
Returns
T
Added element.
Type Parameters
T
The type of the element.
AddCanvas()
Adds a new canvas to the active page.
public XpsCanvas AddCanvas()
Returns
Added canvas.
AddDocument(bool)
Adds an empty document with default page size.
public void AddDocument(bool activate = true)
Parameters
activate
bool
Flag indicating whether to select added document as active.
AddDocument(float, float, bool)
Adds an empty document with the first page dimensions
width
and height
.
public void AddDocument(float width, float height, bool activate = true)
Parameters
width
float
Width of the first page.
height
float
Height of the first page.
activate
bool
Flag indicating whether to select added document as active.
AddGlyphs(string, float, FontStyle, float, float, string)
Adds new glyphs to the active page.
public XpsGlyphs AddGlyphs(string fontFamily, float fontRenderingEmSize, FontStyle fontStyle, float originX, float originY, string unicodeString)
Parameters
fontFamily
string
Font family.
fontRenderingEmSize
float
Font size.
fontStyle
FontStyle
Font style.
originX
float
Glyphs origin X coordinate.
originY
float
Glyphs origin Y coordinate.
unicodeString
string
String to be printed.
Returns
Added glyphs.
AddGlyphs(XpsFont, float, float, float, string)
Adds new glyphs to the active page.
public XpsGlyphs AddGlyphs(XpsFont font, float fontRenderingEmSize, float originX, float originY, string unicodeString)
Parameters
font
XpsFont
Font resource.
fontRenderingEmSize
float
Font size.
originX
float
Glyphs origin X coordinate.
originY
float
Glyphs origin Y coordinate.
unicodeString
string
String to be printed.
Returns
Added glyphs.
AddOutlineEntry(string, int, XpsHyperlinkTarget)
Adds an outline entry to the document.
public void AddOutlineEntry(string description, int outlineLevel, XpsHyperlinkTarget target)
Parameters
description
string
The entry description.
outlineLevel
int
The outline level.
target
XpsHyperlinkTarget
The entry target.
AddPage(bool)
Adds an empty page to the document with default page size.
public XpsPage AddPage(bool activate = true)
Parameters
activate
bool
Flag indicating whether to select added page as active.
Returns
Added page.
AddPage(float, float, bool)
Adds an empty page to the document with specified
width
and height
.
public XpsPage AddPage(float width, float height, bool activate = true)
Parameters
width
float
Width of a new page.
height
float
Height of a new page.
activate
bool
Flag indicating whether to select added page as active.
Returns
Added page.
AddPage(XpsPage, bool)
Adds a page to the document.
public XpsPage AddPage(XpsPage page, bool activate = true)
Parameters
page
XpsPage
Page to be added.
activate
bool
Flag indicating whether to select added page as active.
Returns
Added page.
AddPath(XpsPathGeometry)
Adds a new path to the active page.
public XpsPath AddPath(XpsPathGeometry data)
Parameters
data
XpsPathGeometry
The geometry of the path.
Returns
Added path.
CreateArcSegment(PointF, SizeF, float, bool, XpsSweepDirection, bool)
Creates a new elliptical arc segment.
public XpsArcSegment CreateArcSegment(PointF point, SizeF size, float rotationAngle, bool isLargeArc, XpsSweepDirection sweepDirection, bool isStroked = true)
Parameters
point
PointF
The endpoint of the elliptical arc.
size
SizeF
The x and y radius of the elliptical arc as an x,y pair.
rotationAngle
float
Indicates how the ellipse is rotated relative to the current coordinate system.
isLargeArc
bool
Determines whether the arc is drawn with a sweep of 180 or greater.
sweepDirection
XpsSweepDirection
The direction in which the arc is drawn.
isStroked
bool
Specifies whether the stroke for this segment of the path is drawn.
Returns
New elliptical arc segment.
CreateCanvas()
Creates a new canvas.
public XpsCanvas CreateCanvas()
Returns
New canvas.
CreateColor(Color)
Creates a new color.
public XpsColor CreateColor(Color color)
Parameters
color
Color
A native color instance for RGB color.
Returns
New color.
CreateColor(int, int, int, int)
Creates a new color in sRGB color space.
public XpsColor CreateColor(int a, int r, int g, int b)
Parameters
a
int
The alpha color component.
r
int
The red color component.
g
int
The green color component.
b
int
The blue color component.
Returns
New color.
CreateColor(int, int, int)
Creates a new color in sRGB color space.
public XpsColor CreateColor(int r, int g, int b)
Parameters
r
int
The red color component.
g
int
The green color component.
b
int
The blue color component.
Returns
New color.
CreateColor(float, float, float, float)
Creates a new color in scRGB color space.
public XpsColor CreateColor(float a, float r, float g, float b)
Parameters
a
float
The alpha color component.
r
float
The red color component.
g
float
The green color component.
b
float
The blue color component.
Returns
New color.
CreateColor(float, float, float)
Creates a new color in scRGB color space.
public XpsColor CreateColor(float r, float g, float b)
Parameters
r
float
The red color component.
g
float
The green color component.
b
float
The blue color component.
Returns
New color.
CreateColor(string, params float[])
Creates a new color in ICC based color space.
public XpsColor CreateColor(string path, params float[] components)
Parameters
path
string
The path to the ICC profile.
components
float[]
Color components.
Returns
New color.
CreateColor(XpsIccProfile, params float[])
Creates a new color in ICC based color space.
public XpsColor CreateColor(XpsIccProfile iccProfile, params float[] components)
Parameters
iccProfile
XpsIccProfile
The ICC profile resource.
components
float[]
Color components.
Returns
New color.
CreateFont(string, FontStyle)
Creates a new TrueType font resource.
public XpsFont CreateFont(string fontFamily, FontStyle fontStyle)
Parameters
fontFamily
string
The font family.
fontStyle
FontStyle
The font style.
Returns
New TrueType font resource.
CreateFont(Stream)
Creates a new TrueType font resource out of stream.
public XpsFont CreateFont(Stream stream)
Parameters
stream
Stream
The stream containing the ICC profile to take as a resource.
Returns
New TrueType font resource.
CreateGlyphs(string, float, FontStyle, float, float, string)
Creates new glyphs.
public XpsGlyphs CreateGlyphs(string fontFamily, float fontRenderingEmSize, FontStyle fontStyle, float originX, float originY, string unicodeString)
Parameters
fontFamily
string
Font family.
fontRenderingEmSize
float
Font size.
fontStyle
FontStyle
Font style.
originX
float
Glyphs origin X coordinate.
originY
float
Glyphs origin Y coordinate.
unicodeString
string
String to be printed.
Returns
New glyphs.
CreateGlyphs(XpsFont, float, float, float, string)
Creates new glyphs.
public XpsGlyphs CreateGlyphs(XpsFont font, float fontRenderingEmSize, float originX, float originY, string unicodeString)
Parameters
font
XpsFont
Font resource.
fontRenderingEmSize
float
Font size.
originX
float
Glyphs origin X coordinate.
originY
float
Glyphs origin Y coordinate.
unicodeString
string
String to be printed.
Returns
New glyphs.
CreateGradientStop(XpsColor, float)
Creates a new gradient stop.
public XpsGradientStop CreateGradientStop(XpsColor color, float offset)
Parameters
color
XpsColor
The gradient stop color.
offset
float
The gradient offset.
Returns
New gradient stop.
CreateGradientStop(Color, float)
Creates a new gradient stop.
public XpsGradientStop CreateGradientStop(Color color, float offset)
Parameters
color
Color
The gradient stop color.
offset
float
The gradient offset.
Returns
New gradient stop.
CreateIccProfile(string)
Creates a new ICC profile resource out of ICC profile file located at the
iccProfilePath
.
public XpsIccProfile CreateIccProfile(string iccProfilePath)
Parameters
iccProfilePath
string
The path to the ICC profile to take as a resource.
Returns
New ICC profile resource.
CreateIccProfile(Stream)
Creates a new ICC profile resource out of stream
.
public XpsIccProfile CreateIccProfile(Stream stream)
Parameters
stream
Stream
The stream containing the ICC profile to take as a resource.
Returns
New ICC profile resource.
CreateImage(string)
Creates a new image resource out of image file located at the imagePath
.
public XpsImage CreateImage(string imagePath)
Parameters
imagePath
string
The path to the image to take as a resource.
Returns
New image resource.
CreateImage(Stream)
Creates a new image resource out of stream
.
public XpsImage CreateImage(Stream stream)
Parameters
stream
Stream
The stream containing the image to take as a resource.
Returns
New image resource.
CreateImageBrush(XpsImage, RectangleF, RectangleF)
Creates a new image brush.
public XpsImageBrush CreateImageBrush(XpsImage image, RectangleF viewbox, RectangleF viewport)
Parameters
image
XpsImage
An image resource.
viewbox
RectangleF
The position and dimensions of the brush’s source content.
viewport
RectangleF
The region in the containing coordinate space of the prime brush tile that is (possibly repeatedly) applied to fill the region to which the brush is applied
Returns
New image brush.
CreateImageBrush(string, RectangleF, RectangleF)
Creates a new image brush.
public XpsImageBrush CreateImageBrush(string imagePath, RectangleF viewbox, RectangleF viewport)
Parameters
imagePath
string
The path to the image to take as a brush tile.
viewbox
RectangleF
The position and dimensions of the brush’s source content.
viewport
RectangleF
The region in the containing coordinate space of the prime brush tile that is (possibly repeatedly) applied to fill the region to which the brush is applied
Returns
New image brush.
CreateLinearGradientBrush(List<xpsgradientstop>, PointF, PointF)
Creates a new linear gradient brush.
public XpsLinearGradientBrush CreateLinearGradientBrush(List<xpsgradientstop> gradientStops, PointF startPoint, PointF endPoint)
Parameters
gradientStops
List<XpsGradientStop>
The list of gradient stops.
startPoint
PointF
The starting point of the linear gradient.
endPoint
PointF
The end point of the linear gradient.
Returns
New linear gradient brush.
CreateLinearGradientBrush(PointF, PointF)
Creates a new linear gradient brush.
public XpsLinearGradientBrush CreateLinearGradientBrush(PointF startPoint, PointF endPoint)
Parameters
startPoint
PointF
The starting point of the linear gradient.
endPoint
PointF
The end point of the linear gradient.
Returns
New linear gradient brush.
CreateMatrix(float, float, float, float, float, float)
Creates a new affine transformation matrix.
public XpsMatrix CreateMatrix(float m11, float m12, float m21, float m22, float m31, float m32)
Parameters
m11
float
Element 11.
m12
float
Element 12.
m21
float
Element 21.
m22
float
Element 22.
m31
float
Element 31.
m32
float
Element 32.
Returns
New affine transformation matrix.
CreatePath(XpsPathGeometry)
Creates a new path.
public XpsPath CreatePath(XpsPathGeometry data)
Parameters
data
XpsPathGeometry
The geometry of the path.
Returns
New path.
CreatePathFigure(PointF, bool)
Creates a new path figure.
public XpsPathFigure CreatePathFigure(PointF startPoint, bool isClosed = false)
Parameters
startPoint
PointF
The starting point for the first segment of the path figure.
isClosed
bool
Specifies whether the path is closed. If set to true, the stroke is drawn “closed”, that is, the last point in the last segment of the path figure is connected with the point specified in the StartPoint attribute, otherwise the stroke is drawn “open”, and the last point is not connected to the start point. Only applicable if the path figure is used in a Path element that specifies a stroke.
Returns
New path figure.
CreatePathFigure(PointF, List<xpspathsegment>, bool)
Creates a new path figure.
public XpsPathFigure CreatePathFigure(PointF startPoint, List<xpspathsegment> segments, bool isClosed = false)
Parameters
startPoint
PointF
The starting point for the first segment of the path figure.
segments
List<XpsPathSegment>
List of path segments.
isClosed
bool
Specifies whether the path is closed. If set to true, the stroke is drawn “closed”, that is, the last point in the last segment of the path figure is connected with the point specified in the StartPoint attribute, otherwise the stroke is drawn “open”, and the last point is not connected to the start point. Only applicable if the path figure is used in a Path element that specifies a stroke.
Returns
New path figure.
CreatePathGeometry(string)
Creates a new path geometry specified with abbreviated form.
public XpsPathGeometry CreatePathGeometry(string abbreviatedGeometry)
Parameters
abbreviatedGeometry
string
Abbreviated form of path geometry.
Returns
New path geometry.
CreatePathGeometry()
Creates a new path geometry.
public XpsPathGeometry CreatePathGeometry()
Returns
New path geometry.
CreatePathGeometry(List<xpspathfigure>)
Creates a new path geometry with specified list of path figures.
public XpsPathGeometry CreatePathGeometry(List<xpspathfigure> pathFigures)
Parameters
pathFigures
List<XpsPathFigure>
List of path figures.
Returns
New path geometry.
CreatePolyBezierSegment(PointF[], bool)
Creates a new set of cubic Bézier curves.
public XpsPolyBezierSegment CreatePolyBezierSegment(PointF[] points, bool isStroked = true)
Parameters
points
PointF[]
Control points for multiple Bézier segments.
isStroked
bool
Specifies whether the stroke for this segment of the path is drawn.
Returns
New cubic Bézier curves segment.
CreatePolyLineSegment(PointF[], bool)
Creates a new polygonal drawing containing an arbitrary number of individual vertices.
public XpsPolyLineSegment CreatePolyLineSegment(PointF[] points, bool isStroked = true)
Parameters
points
PointF[]
A set of coordinates for the multiple segments that define the poly line segment.
isStroked
bool
Specifies whether the stroke for this segment of the path is drawn.
Returns
New polygonal drawing segment.
CreatePolyQuadraticBezierSegment(PointF[], bool)
Creates a new set of quadratic Bézier curves from the previous point in the path figure through a set of vertices, using specified control points.
public XpsPolyQuadraticBezierSegment CreatePolyQuadraticBezierSegment(PointF[] points, bool isStroked = true)
Parameters
points
PointF[]
Control points for multiple quadratic Bézier segments.
isStroked
bool
Specifies whether the stroke for this segment of the path is drawn.
Returns
New quadratic Bézier curves segment.
CreateRadialGradientBrush(List<xpsgradientstop>, PointF, PointF, float, float)
Creates a new radial gradient brush.
public XpsRadialGradientBrush CreateRadialGradientBrush(List<xpsgradientstop> gradientStops, PointF center, PointF gradientOrigin, float radiusX, float radiusY)
Parameters
gradientStops
List<XpsGradientStop>
The list of gradient stops.
center
PointF
The center point of the radial gradient (that is, the center of the ellipse).
gradientOrigin
PointF
The origin point of the radial gradient.
radiusX
float
The radius in the x dimension of the ellipse which defines the radial gradient.
radiusY
float
The radius in the y dimension of the ellipse which defines the radial gradient.
Returns
New radial gradient brush.
CreateRadialGradientBrush(PointF, PointF, float, float)
Creates a new radial gradient brush.
public XpsRadialGradientBrush CreateRadialGradientBrush(PointF center, PointF gradientOrigin, float radiusX, float radiusY)
Parameters
center
PointF
The center point of the radial gradient (that is, the center of the ellipse).
gradientOrigin
PointF
The origin point of the radial gradient.
radiusX
float
The radius in the x dimension of the ellipse which defines the radial gradient.
radiusY
float
The radius in the y dimension of the ellipse which defines the radial gradient.
Returns
New radial gradient brush.
CreateSolidColorBrush(XpsColor)
Creates a new solid color brush.
public XpsSolidColorBrush CreateSolidColorBrush(XpsColor color)
Parameters
color
XpsColor
The color for filled elements.
Returns
New solid color brush.
CreateSolidColorBrush(Color)
Creates a new solid color brush.
public XpsSolidColorBrush CreateSolidColorBrush(Color color)
Parameters
color
Color
The color for filled elements.
Returns
New solid color brush.
CreateVisualBrush(XpsContentElement, RectangleF, RectangleF)
Creates a new visual brush.
public XpsVisualBrush CreateVisualBrush(XpsContentElement element, RectangleF viewbox, RectangleF viewport)
Parameters
element
XpsContentElement
The XPS element (Canvas, Path or Glyphs) for Visual property od visual brush.
viewbox
RectangleF
The position and dimensions of the brush’s source content.
viewport
RectangleF
The region in the containing coordinate space of the prime brush tile that is (possibly repeatedly) applied to fill the region to which the brush is applied
Returns
New visual brush.
Dispose()
Disposes the instance.
public void Dispose()
GetDocumentPrintTicket(int)
Returns the print ticket of the document indexed by documentIndex
.
public DocumentPrintTicket GetDocumentPrintTicket(int documentIndex)
Parameters
documentIndex
int
Index of the document whose print ticket to return.
Returns
Document’s print ticket.
GetPagePrintTicket(int, int)
Returns the print ticket of the page indexed by pageIndex
in the document indexed by documentIndex
.
public PagePrintTicket GetPagePrintTicket(int documentIndex, int pageIndex)
Parameters
documentIndex
int
Index of the document.
pageIndex
int
Index of the page whose print ticket to return.
Returns
Page’s print ticket.
Insert<t>(int, T)
Inserts an element (Canvas, Path, or Glyphs) to the active page at index
position.
public T Insert<t>(int index, T element) where T : XpsContentElement
Parameters
index
int
Position at which an element
should be inserted.
element
T
Element to be inserted.
Returns
T
Inserted element.
Type Parameters
T
The type of the element.
InsertCanvas(int)
Inserts a new canvas to the active page at index
position.
public XpsCanvas InsertCanvas(int index)
Parameters
index
int
Position at which a new canvas should be inserted.
Returns
Inserted canvas.
InsertDocument(int, bool)
Inserts an empty document with default page size
at index
position.
public void InsertDocument(int index, bool activate = true)
Parameters
index
int
Position at which a document should be inserted.
activate
bool
Flag indicating whether to select inserted document as active.
InsertDocument(int, float, float, bool)
Inserts an empty document with the first page dimensions
width
and height
at index
position.
public void InsertDocument(int index, float width, float height, bool activate = true)
Parameters
index
int
Position at which a document should be inserted.
width
float
Width of the first page.
height
float
Height of the first page.
activate
bool
Flag indicating whether to select inserted document as active.
InsertGlyphs(int, string, float, FontStyle, float, float, string)
Inserts new glyphs to the active page at index
position.
public XpsGlyphs InsertGlyphs(int index, string fontFamily, float fontSize, FontStyle fontStyle, float originX, float originY, string unicodeString)
Parameters
index
int
Position at which new glyphs should be inserted.
fontFamily
string
Font family.
fontSize
float
Font size.
fontStyle
FontStyle
Font style.
originX
float
Glyphs origin X coordinate.
originY
float
Glyphs origin Y coordinate.
unicodeString
string
String to be printed.
Returns
Inserted glyphs.
InsertGlyphs(int, XpsFont, float, float, float, string)
Inserts new glyphs to the active page at index
position.
public XpsGlyphs InsertGlyphs(int index, XpsFont font, float fontSize, float originX, float originY, string unicodeString)
Parameters
index
int
Position at which new glyphs should be inserted.
font
XpsFont
Font resource.
fontSize
float
Font size.
originX
float
Glyphs origin X coordinate.
originY
float
Glyphs origin Y coordinate.
unicodeString
string
String to be printed.
Returns
Inserted glyphs.
InsertPage(int, bool)
Inserts an empty page to the document with default page size
at index
position.
public XpsPage InsertPage(int index, bool activate = true)
Parameters
index
int
Position at which a page should be inserted.
activate
bool
Flag indicating whether to select inserted page as active.
Returns
Inserted page.
InsertPage(int, float, float, bool)
Inserts an empty page to the document with specified
width
and height
at index
position.
public XpsPage InsertPage(int index, float width, float height, bool activate = true)
Parameters
index
int
Position at which a page should be inserted.
width
float
Width of a new page.
height
float
Height of a new page.
activate
bool
Flag indicating whether to select inserted page as active.
Returns
Inserted page.
InsertPage(int, XpsPage, bool)
Inserts a page to the document at index
position.
public XpsPage InsertPage(int index, XpsPage page, bool activate = true)
Parameters
index
int
Position at which a page should be added.
page
XpsPage
Page to be inserted.
activate
bool
Flag indicating whether to select inserted page as active.
Returns
Inserted page.
InsertPath(int, XpsPathGeometry)
Inserts a new path to the active page at index
position.
public XpsPath InsertPath(int index, XpsPathGeometry data)
Parameters
index
int
Position at which a new path should be inserted.
data
XpsPathGeometry
The geometry of the path.
Returns
Inserted path.
Merge(string[], string)
Merging several XPS files to one XPS document.
public void Merge(string[] filesForMerge, string outXpsFilePath)
Parameters
filesForMerge
string[]
XPS files for merging with this document.
outXpsFilePath
string
An output Xps file path.
Merge(string[], Stream)
Merging several XPS files to one XPS document.
public void Merge(string[] filesForMerge, Stream outStream)
Parameters
filesForMerge
string[]
XPS files for merging with this document.
outStream
Stream
The output stream where to save merged XPS documents.
MergeToPdf(string[], string, PdfSaveOptions)
Merging XPS documents to PDF using the Aspose.Page.Device instance.
public void MergeToPdf(string[] filesForMerge, string outPdfFilePath, PdfSaveOptions options)
Parameters
filesForMerge
string[]
XPS files for merging with this document to an output device.
outPdfFilePath
string
An output PDF file path.
options
PdfSaveOptions
Document saving options.
MergeToPdf(string[], Stream, PdfSaveOptions)
Merging XPS documents to PDF using the Aspose.Page.Device instance.
public void MergeToPdf(string[] filesForMerge, Stream pdfStream, PdfSaveOptions options)
Parameters
filesForMerge
string[]
XPS files for merging with this document to an output device.
pdfStream
Stream
An output PDF stream.
options
PdfSaveOptions
Document saving options.
Remove<t>(T)
Removes an element from the active page.
public T Remove<t>(T element) where T : XpsContentElement
Parameters
element
T
Element to be removed.
Returns
T
Removed element.
Type Parameters
T
The type of the element.
RemoveAt(int)
Removes an element at index
position from the active page.
public XpsContentElement RemoveAt(int index)
Parameters
index
int
Position at which element should be removed.
Returns
Removed element.
RemoveDocumentAt(int)
Removes a document at index
position.
public void RemoveDocumentAt(int index)
Parameters
index
int
Position at which a document should be removed.
RemovePage(XpsPage)
Removes a page from the document.
public XpsPage RemovePage(XpsPage page)
Parameters
page
XpsPage
Page to be removed.
Returns
Removed page.
RemovePageAt(int)
Removes a page from the document at index
position.
public XpsPage RemovePageAt(int index)
Parameters
index
int
Position at which a page should be removed.
Returns
Removed page.
Save(string)
Saves XPS document to XPS file located at the path
.
public void Save(string path)
Parameters
path
string
Location of the document.
Save(Stream)
Saves XPS document to stream.
public void Save(Stream stream)
Parameters
stream
Stream
Stream XPS document to be saved into.
SaveAsImage(ImageSaveOptions)
Saves the document in a bitmap image format.
public byte[][][] SaveAsImage(ImageSaveOptions options)
Parameters
options
ImageSaveOptions
Options for saving the document in a bitmap image format.
Returns
byte[][][]
The resulting images byte arrays. The first dimension is for inner documents and the second one is for pages within inner documents.
SaveAsPdf(string, PdfSaveOptions)
Saves the document in PDF format.
public void SaveAsPdf(string outPdfFilePath, PdfSaveOptions options)
Parameters
outPdfFilePath
string
An output PDF file path.
options
PdfSaveOptions
Options for saving the document in PDF format.
SaveAsPdf(Stream, PdfSaveOptions)
Saves the document in PDF format.
public void SaveAsPdf(Stream stream, PdfSaveOptions options)
Parameters
stream
Stream
The stream to write the output PDF file to.
options
PdfSaveOptions
Options for saving the document in PDF format.
SaveAsPs(string, PsSaveOptions)
Saves the document in PS format.
public void SaveAsPs(string outPsFilePath, PsSaveOptions options)
Parameters
outPsFilePath
string
An output PS file path.
options
PsSaveOptions
Options for saving the document in PS format.
SaveAsPs(Stream, PsSaveOptions)
Saves the document in PS format.
public void SaveAsPs(Stream stream, PsSaveOptions options)
Parameters
stream
Stream
The stream to write the output PS file to.
options
PsSaveOptions
Options for saving the document in PS format.
SelectActiveDocument(int)
Selects an active document for editing.
public void SelectActiveDocument(int documentNumber)
Parameters
documentNumber
int
A document number.
Exceptions
Thrown when
documentNumber
is out of bounds.
SelectActivePage(int)
Selects an active document page for editing.
public XpsPage SelectActivePage(int pageNumber)
Parameters
pageNumber
int
A page number.
Returns
Aspose.Page.XPS.XpsModel.XpsPage instance for active page.
Exceptions
Thrown when
pageNumber
is out of bounds.
SetDocumentPrintTicket(int, DocumentPrintTicket)
Links the printTicket
to the document indexed by documentIndex
.
public void SetDocumentPrintTicket(int documentIndex, DocumentPrintTicket printTicket)
Parameters
documentIndex
int
Index of the document to link the print ticket to.
printTicket
DocumentPrintTicket
The print ticket to link.
SetPagePrintTicket(int, int, PagePrintTicket)
Links the printTicket
to the page indexed by pageIndex
in the document indexed by documentIndex
.
public void SetPagePrintTicket(int documentIndex, int pageIndex, PagePrintTicket printTicket)
Parameters
documentIndex
int
Index of the document.
pageIndex
int
Index of the page to link the print ticket to.
printTicket
PagePrintTicket
The print ticket to link. </t></t></xpsgradientstop></xpspathfigure></xpspathsegment></xpsgradientstop></t>