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

    Show / Hide Table of Contents

    PageSetup Class

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

    Represents the page setup properties of a Section.

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

    For more information, see page setup example.

    Constructors

    PageSetup()

    Initializes a new instance of the PageSetup class.

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

    Properties

    LineNumberCountBy

    Gets or sets the line number increments to be displayed.

    Although each line has an associated line number, only lines which are an even multiple of this value shall be displayed.

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

    The line number increments to be displayed in the current section.

    LineNumberDistanceFromText

    Gets or sets the line number distance from text (in points).

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

    The line number distance from text.

    Remarks

    Set to 0 for automatic distance (Auto).

    LineNumberRestartSetting

    Gets or sets the line number restart setting.

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

    The line number restart setting.

    LineStartingNumber

    Gets or sets the line starting number.

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

    The line starting number.

    Orientation

    Gets or sets the page orientation.

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

    The page orientation.

    Remarks

    Changing of Orientation property swaps values of PageWidth and PageHeight properties.

    This member is supported in Print().

    GemBox.Document uses enhanced printing services provided with Windows Presentation Foundation (WPF). All pages of a specific Section will be printed with settings from PageSetup of that section. Internally, WPF printing uses PrintTicket class to specify page printing settings and value of this member is applied to appropriate member of PrintTicket instance which is used to print all pages of a section with this print options member.

    PrintTicket instance which is used to print every page of a section is constructed in following order:

    Printing settings which do not exist in PrintOptions nor in PageSetup can be specified on base print ticket (which stream is passed to PrintOptions(Stream) constructor).

    PageBorders

    Gets the page borders.

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

    The page borders.

    See Also
    PageBorders
    SingleBorder

    PageColor

    Gets or sets the background color for all pages of the parent section.

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

    The background color for all pages of the parent section.

    Remarks

    If page color is not set or is set to Empty, it will be inherited from previous section. If page color is not set for the first section, then it defaults to Empty.

    DOCX format supports only single page color for an entire document, so page color of the first section will be used for an entire document. Page colors of the subsequent sections won't be stored into DOCX format.

    PageHeight

    Gets or sets the height of the page (in points).

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

    The height of the page.

    PageMargins

    Gets or sets the page margins.

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

    The page margins.

    PageNumberStyle

    Gets or sets the number style for the page number.

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

    Number style for the page number.

    PageStartingNumber

    Gets or sets the number that appears on the first page of the section.

    • C#
    • VB.NET
    public int? PageStartingNumber { get; set; }
    Public Property PageStartingNumber As Integer?
    Property Value
    System.Nullable<System.Int32>

    The page starting number.

    Remarks

    Specifies the page number that appears on the first page of the section.

    If this value is omitted, numbering will continue from the highest page number in the previous section.

    PageWidth

    Gets or sets the width of the page (in points).

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

    The width of the page.

    PaperType

    Gets or sets the type of the paper for the page.

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

    The type of the paper.

    Remarks

    Default value for this property is A4.

    This member is supported in Print().

    GemBox.Document uses enhanced printing services provided with Windows Presentation Foundation (WPF). All pages of a specific Section will be printed with settings from PageSetup of that section. Internally, WPF printing uses PrintTicket class to specify page printing settings and value of this member is applied to appropriate member of PrintTicket instance which is used to print all pages of a section with this print options member.

    PrintTicket instance which is used to print every page of a section is constructed in following order:

    Printing settings which do not exist in PrintOptions nor in PageSetup can be specified on base print ticket (which stream is passed to PrintOptions(Stream) constructor).

    RightToLeft

    Gets or sets whether the direction of the section is right-to-left. Default value is false.

    • C#
    • VB.NET
    public bool RightToLeft { get; set; }
    Public Property RightToLeft As Boolean
    Property Value
    System.Boolean

    true if the direction of the section is right-to-left; otherwise, false.

    SectionStart

    Gets or sets the type of section start.

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

    The type of section start.

    TextColumns

    Gets or sets the text columns.

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

    The text columns.

    VerticalAlignment

    Gets or sets the vertical alignment of text on each page in the section. Supported only in DOCX format.

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

    The vertical alignment of the text in the section's pages.

    Methods

    Clone()

    Clones this PageSetup instance.

    • C#
    • VB.NET
    public PageSetup Clone()
    Public Function Clone As PageSetup
    Returns
    PageSetup

    Cloned PageSetup.

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.