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

    Show / Hide Table of Contents

    PrintOptions Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Specifies information about how a spreadsheet is printed.

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

    Constructors

    PrintOptions()

    Initializes a new instance of the PrintOptions class.

    • C#
    • VB.NET
    public PrintOptions()
    Public Sub New

    PrintOptions(MemoryStream)

    Initializes a new instance of the PrintOptions class by using an XML stream (that contains a PrintTicket document) that complies with the XML Print Schema.

    • C#
    • VB.NET
    public PrintOptions(MemoryStream xmlStream)
    Public Sub New(xmlStream As MemoryStream)
    Parameters
    xmlStream
    System.IO.MemoryStream

    An XML stream that describes a print job and conforms to the Print Schema.

    Exceptions
    System.ArgumentNullException

    xmlStream is null.

    See Also
    System.Printing.PrintTicket
    System.Printing.PrintTicket.GetXmlStream
    Print Schema

    Properties

    CopyCount

    Gets or sets the number of copies of the document to print.

    • C#
    • VB.NET
    public int CopyCount { get; set; }
    Public Property CopyCount As Integer
    Property Value
    System.Int32

    DocumentName

    Gets or sets the name of the printed document in the print queue.

    Default value is 'Spreadsheet'.

    • C#
    • VB.NET
    public string DocumentName { get; set; }
    Public Property DocumentName As String
    Property Value
    System.String

    The name of the printed document in the print queue.

    ExtendedOptions

    Gets the extended save options that are not natively supported by spreadsheet formats.

    • C#
    • VB.NET
    public ExtendedSaveOptions ExtendedOptions { get; }
    Public ReadOnly Property ExtendedOptions As ExtendedSaveOptions
    Property Value
    ExtendedSaveOptions

    Extended save options that are not natively supported by spreadsheet formats.

    FromPage

    Gets or sets the page index of the first page to print.

    • C#
    • VB.NET
    public int FromPage { get; set; }
    Public Property FromPage As Integer
    Property Value
    System.Int32
    Remarks

    Spreadsheet pages are zero-indexed meaning that first page in the spreadsheet has index 0 (zero).

    MetafileScaleFactor

    Gets or sets the scaling factor for rendering metafile (WMF and EMF) images. Greater scaling factor improves quality but also increases file size. Default value is 1.

    • C#
    • VB.NET
    public double MetafileScaleFactor { get; set; }
    Public Property MetafileScaleFactor As Double
    Property Value
    System.Double

    The metafile scale factor for rendering metafile (WMF and EMF) images.

    Remarks

    Windows Metafile Format (WMF) and Enhanced Metafile Format (EMF) are vector image formats which contain a series of graphics drawing commands usually executed in Windows GDI layer.

    Metafile drawing commands could also be executed in PDF (or XPS) file which is also vector format, but for that Metafile drawing commands would have to be converted to PDF drawing commands.

    GemBox.Document currently doesn't perform this conversion of drawing commands, instead it uses Windows GDI to execute Metafile drawing commands into bitmap which is then encoded to PNG format and embedded into PDF file.

    MetafileScaleFactor specifies the size of the bitmap surface, based from the original Metafile surface size, into which Metafile should be drawn / rasterized.

    PDF viewer will still scale the bitmap to the original Metafile size, but if the page is zoomed or viewed on a larger surface, quality of the image will be better since it contains more pixels / dots which will become visible while PDF viewer scales down the image.

    MetafileScaleFactor increases the quality of the Metafile image in PDF file, but it also increases the size of the PDF file because greater MetafileScaleFactor means greater bitmap surface and more space to store bitmap pixel / color data. PNG encoding / compression helps in reducing the space requirement and for complex Metafiles (with a lot of drawing instructions), MetafileScaleFactor of 5 or even greater, might not incur any space overhead relative to the original (complex) Metafile.

    Default value for MetafileScaleFactor is 1.

    PagesPerSheet

    Gets or sets the number of pages that print on each printed side of a sheet of paper.

    • C#
    • VB.NET
    public int PagesPerSheet { get; set; }
    Public Property PagesPerSheet As Integer
    Property Value
    System.Int32
    Remarks

    Only a limited range of 1, 2, 4, 6, 8 or 16 pages per sheet side are supported.

    SelectionType

    Gets or sets a value indicating whether to save the whole ExcelFile or just ActiveWorksheet.

    • C#
    • VB.NET
    public SelectionType SelectionType { get; set; }
    Public Property SelectionType As SelectionType
    Property Value
    SelectionType

    ToPage

    Gets or sets the index of the last page to print.

    • C#
    • VB.NET
    public int ToPage { get; set; }
    Public Property ToPage As Integer
    Property Value
    System.Int32
    Remarks

    Use System.Int32.MaxValue value to print to the last page.

    Examples

    Print Excel in C# and VB.NET
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.