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

    Show / Hide Table of Contents

    PageBorders Class

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

    Represents a set of page borders.

    • C#
    • VB.NET
    public sealed class PageBorders : MultipleBorders, IEnumerable
    Public NotInheritable Class PageBorders
        Inherits MultipleBorders
        Implements IEnumerable
    Inheritance:
    System.Object
    MultipleBorders
    PageBorders
    Implements
    System.Collections.IEnumerable
    Remarks

    PageBorders class is used to set borders for Section element.

    Section supports Outside borders.

    Properties

    AlignParagraphBordersAndTableEdgesWithPageBorder

    Gets or sets a value indicating whether paragraph borders specified using the Borders property and table borders using the Borders property shall be adjusted to align with extents of the page border defined using the PageBorders property if the spacing between these borders is less than or equal to 10.5 points (one character width) or less from the page border.

    true value of this property shall ensure there are no gaps of one character width or less between adjoining page and paragraph/table borders, as borders which are perfectly aligning shall not be displayed in favor of the intervening page border.

    If value of this property is true, then borders shall not be automatically adjusted to prevent gaps of less than one character width.

    If the page border is not measured from the text extents (MeasureFromEdgeOfPage is true), then this property is ignored.

    This property is stored in DocumentSettings, therefore it applies to the entire document.

    Supported only in DOCX and DOC formats. This value is currently ignored when exporting a document to PDF, XPS, or image formats.

    Default value: false.

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

    true if paragraph borders specified using the Borders property and table borders using the Borders property shall be adjusted to align with extents of the page border defined using the PageBorders property if the spacing between these borders is less than or equal to 10.5 points (one character width) or less from the page border; otherwise, false.

    Exceptions
    System.InvalidOperationException

    DocumentSettings cannot be accessed from this PageBorders either because PageSetup has been removed from the parent Section or because Section has been removed from the parent DocumentModel.

    AlwaysDisplayInFront

    Gets or sets a value indicating whether the page border is positioned above or below intersecting texts and objects in this document.

    Default value: true.

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

    true to render the page border above any text or object which intersects it - effectively placing it at the highest z-order on the page.; otherwise, false to render the page border beneath any text or object which intersects it - effectively placing it at the lowest z-order on the page.

    ApplyToAllExceptFirstPage

    Gets or sets a value indicating whether to apply page borders to all pages of the section, except the first page.

    Default value: false.

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

    true to apply page borders to all pages of the section, except the first page; otherwise, false.

    ApplyToFirstPageOnly

    Gets or sets a value indicating whether to apply page borders to only the first page of the section.

    Default value: false.

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

    true to apply page borders to only the first page of the section; otherwise, false.

    MeasureFromEdgeOfPage

    Gets or sets a value indicating whether the Space property on each page SingleBorder shall be interpreted as the distance from the edge of the page or as the distance from the PageMargins that shall be left before the page border.

    Default value: true.

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

    true to interpret the Space property on each page SingleBorder as the distance from the edge of the page that shall be left before the page border; otherwise, false to interpret it as the distance from the PageMargins that shall be left before the page border.

    SurroundFooter

    Gets or sets a value indicating whether the document’s page border specified using the PageBorders property should surround contents of the footer.

    If the page border is not measured from the text extents (MeasureFromEdgeOfPage is true), then this property is ignored.

    This property is stored in DocumentSettings, therefore it applies to the entire document.

    Default value: true.

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

    true if the document’s page border specified using the PageBorders property should surround contents of the footer; otherwise, false.

    Exceptions
    System.InvalidOperationException

    DocumentSettings cannot be accessed from this PageBorders either because PageSetup has been removed from the parent Section or because Section has been removed from the parent DocumentModel.

    SurroundHeader

    Gets or sets a value indicating whether the document’s page border specified using the PageBorders property should surround contents of the header.

    If the page border is not measured from the text extents (MeasureFromEdgeOfPage is true), then this property is ignored.

    This property is stored in DocumentSettings, therefore it applies to the entire document.

    Default value: true.

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

    true if the document’s page border specified using the PageBorders property should surround contents of the header; otherwise, false.

    Exceptions
    System.InvalidOperationException

    DocumentSettings cannot be accessed from this PageBorders either because PageSetup has been removed from the parent Section or because Section has been removed from the parent DocumentModel.

    Inherited Properties

    Item[SingleBorderType]

    Gets the SingleBorder for the specified SingleBorderType.

    (Inherited from MultipleBorders)

    SupportedBorderTypes

    Gets the supported border types.

    (Inherited from MultipleBorders)

    Inherited Methods

    Add(MultipleBorderTypes, BorderStyle, Color, System.Double)

    Sets the specified borders. This method is required to support C# collection initializer syntax and redirects its call to the SetBorders(MultipleBorderTypes, BorderStyle, Color, Double) method.

    (Inherited from MultipleBorders)

    ClearBorders()

    Clears all borders.

    (Inherited from MultipleBorders)

    ClearBorders(MultipleBorderTypes)

    Clears the specified borders.

    (Inherited from MultipleBorders)

    Equals(System.Object)

    Determines whether the specified System.Object is equal to this MultipleBorders instance.

    (Inherited from MultipleBorders)

    GetHashCode()

    Returns a hash code for this MultipleBorders instance.

    (Inherited from MultipleBorders)

    SetBorders(MultipleBorderTypes, BorderStyle, Color, System.Double)

    Sets the specified borders.

    (Inherited from MultipleBorders)

    SetBorders(MultipleBorderTypes, BorderStyle, Color, System.Double, System.Double)

    Sets the specified borders.

    (Inherited from MultipleBorders)

    ToSingleBorderTypes(MultipleBorderTypes)

    Converts a MultipleBorderTypes flags enumeration to a sequence of SingleBorderType enumeration.

    (Inherited from MultipleBorders)

    Implements

    System.Collections.IEnumerable

    See Also

    SingleBorder
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.