DocumentModelPaginator Class
Provides a functionality to paginate the document content.
public sealed class DocumentModelPaginator
Public NotInheritable Class DocumentModelPaginator
- Inheritance:
- DocumentModelPaginator
Properties
Pages
Gets the document pages.
public ReadOnlyCollection<DocumentModelPage> Pages { get; }
Public ReadOnly Property Pages As ReadOnlyCollection(Of DocumentModelPage)
Property Value
The document pages.
Methods
ConvertToImageSource(ImageSaveOptions)
Converts single page specified in options
of this DocumentModelPaginator instance to an ImageSource instance.
public ImageSource ConvertToImageSource(ImageSaveOptions options)
Public Function ConvertToImageSource(options As ImageSaveOptions) As ImageSource
Parameters
options
- ImageSaveOptions
The options used when converting a single document's page to an image.
Returns
A new ImageSource instance created from a single document's page specified in options
.
See Also
ConvertToXpsDocument(XpsSaveOptions)
Converts this DocumentModelPaginator instance to an XpsDocument instance.
public XpsDocument ConvertToXpsDocument(XpsSaveOptions options)
Public Function ConvertToXpsDocument(options As XpsSaveOptions) As XpsDocument
Parameters
options
- XpsSaveOptions
The options used when converting to XML Paper Specification (XPS) document.
Returns
A new XpsDocument instance created from this DocumentModelPaginator instance.
See Also
Print()
Prints the paginated document to the default printer.
Print(String)
Prints the paginated document to the specified printer.
Parameters
printerName
- String
Printer name.
Print(String, PrintOptions)
Prints the paginated document to the specified printer according to specified options.
public void Print(string printerName, PrintOptions options)
Public Sub Print(printerName As String, options As PrintOptions)
Parameters
printerName
- String
Printer name.
options
- PrintOptions
Print options.
Save(Stream, SaveOptions)
Saves the paginated document to the specified stream.
public void Save(Stream stream, SaveOptions options)
Public Sub Save(stream As Stream, options As SaveOptions)
Parameters
stream
- Stream
The stream in which to save the paginated document.
options
- SaveOptions
The saving options which can be used to define settings for save operation.
Remarks
Parameter options
, currently, must be of type PdfSaveOptions, XpsSaveOptions or ImageSaveOptions.
Save(String)
Saves the paginated document to a file with the specified path. Path must include file extension.
Parameters
path
- String
The path to which to save the paginated document.
Remarks
File extension that is extracted from the path
is used to create the appropriate SaveOptions derived class instance that is then passed to the Save(String, SaveOptions) method.
Following file extensions are supported:
- Portable Document Format: .pdf
- XML Paper Specification: .xps
- Image: .bmp, .gif, .jpg, .jpeg, .png, .tif, .tiff, .wdp
Exceptions
If file extension is not specified or not supported. If file extension is not recognized, use Save(String, SaveOptions) method overload instead.
Save(String, SaveOptions)
Saves the paginated document to a file with the specified path.
public void Save(string path, SaveOptions options)
Public Sub Save(path As String, options As SaveOptions)
Parameters
path
- String
The path to which to save the paginated document.
options
- SaveOptions
The saving options which can be used to define settings for save operation.
Remarks
Parameter options
, currently, must be of type PdfSaveOptions, XpsSaveOptions or ImageSaveOptions.