GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    DocumentModelPaginator Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Provides a functionality to paginate the document content.

    • C#
    • VB.NET
    public sealed class DocumentModelPaginator
    Public NotInheritable Class DocumentModelPaginator
    Inheritance:
    System.Object
    DocumentModelPaginator

    Properties

    Pages

    Gets the document pages.

    • C#
    • VB.NET
    public ReadOnlyCollection<DocumentModelPage> Pages { get; }
    Public ReadOnly Property Pages As ReadOnlyCollection(Of DocumentModelPage)
    Property Value
    System.Collections.ObjectModel.ReadOnlyCollection<DocumentModelPage>

    The document pages.

    Methods

    ConvertToDocument()

    Extracts a DocumentModel from this paginator.

    • C#
    • VB.NET
    public DocumentModel ConvertToDocument()
    Public Function ConvertToDocument As DocumentModel
    Returns
    DocumentModel

    The extracted document model.

    ConvertToImageSource(ImageSaveOptions)

    Converts single page specified in options of this DocumentModelPaginator instance to an System.Windows.Media.ImageSource instance.

    • C#
    • VB.NET
    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
    System.Windows.Media.ImageSource

    A new System.Windows.Media.ImageSource instance created from a single document's page specified in options.

    See Also
    ImageSaveOptions

    ConvertToXpsDocument(XpsSaveOptions)

    Converts this DocumentModelPaginator instance to an System.Windows.Xps.Packaging.XpsDocument instance.

    • C#
    • VB.NET
    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
    System.Windows.Xps.Packaging.XpsDocument

    A new System.Windows.Xps.Packaging.XpsDocument instance created from this DocumentModelPaginator instance.

    See Also
    XpsSaveOptions

    GetRange(Int32, Int32)

    Gets a segment of pages of the source paginated document.

    • C#
    • VB.NET
    public DocumentModelPaginator GetRange(int pageNumber, int pageCount)
    Public Function GetRange(pageNumber As Integer, pageCount As Integer) As DocumentModelPaginator
    Parameters
    pageNumber
    System.Int32

    The zero-based index of the first page in the segment.

    pageCount
    System.Int32

    The number of pages in the segment.

    Returns
    DocumentModelPaginator

    A DocumentModelPaginator that represents a segment of pages of the source paginated document.

    Remarks

    This method doesn't repaginate the document, it only returns the subrange of already paginated pages.

    Print()

    Prints the paginated document to the default printer.

    • C#
    • VB.NET
    public void Print()
    Public Sub Print

    Print(String)

    Prints the paginated document to the specified printer.

    • C#
    • VB.NET
    public void Print(string printerName)
    Public Sub Print(printerName As String)
    Parameters
    printerName
    System.String

    Printer name.

    Print(String, PrintOptions)

    Prints the paginated document to the specified printer according to specified options.

    • C#
    • VB.NET
    public void Print(string printerName, PrintOptions options)
    Public Sub Print(printerName As String, options As PrintOptions)
    Parameters
    printerName
    System.String

    Printer name.

    options
    PrintOptions

    Print options.

    Save(Stream, SaveOptions)

    Saves the paginated document to the specified stream.

    • C#
    • VB.NET
    public void Save(Stream stream, SaveOptions options)
    Public Sub Save(stream As Stream, options As SaveOptions)
    Parameters
    stream
    System.IO.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.

    Save(String)

    Saves the paginated document to a file with the specified path. Path must include file extension.

    • C#
    • VB.NET
    public void Save(string path)
    Public Sub Save(path As String)
    Parameters
    path
    System.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.

    Exceptions
    System.InvalidOperationException

    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.

    • C#
    • VB.NET
    public void Save(string path, SaveOptions options)
    Public Sub Save(path As String, options As SaveOptions)
    Parameters
    path
    System.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.

    Examples

    Export Word to ImageSource in WPF
    Export Word to XpsDocument in WPF
    Print Word files in C# and VB.NET
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.