Search Results for

    Show / Hide Table of Contents

    Class PageSetup

    Represents the page setup and layout settings for a section in the document.

    Inheritance
    System.Object
    PageSetup
    Namespace: IronWord.Models
    Assembly: IronWord.dll
    Syntax
    public class PageSetup : Object

    Constructors

    PageSetup()

    Initialize a new instance of PageSetup with default settings.

    Declaration
    public PageSetup()

    Properties

    BottomMargin

    Gets or sets the margin size at the bottom of the page in twips.

    Declaration
    public double BottomMargin { get; set; }
    Property Value
    Type Description
    System.Double

    Footer

    Gets or sets height of the page footer in twips.

    Declaration
    public double Footer { get; set; }
    Property Value
    Type Description
    System.Double

    Gutter

    Gets or sets print Gutter of the page in twips.

    Declaration
    public double Gutter { get; set; }
    Property Value
    Type Description
    System.Double

    Header

    Gets or sets height of the page header in twips.

    Declaration
    public double Header { get; set; }
    Property Value
    Type Description
    System.Double

    LeftMargin

    Gets or sets the margin size at the left of the page in twips.

    Declaration
    public double LeftMargin { get; set; }
    Property Value
    Type Description
    System.Double

    Orientation

    Gets or sets the paper orientation.

    Declaration
    public PageOrientation Orientation { get; set; }
    Property Value
    Type Description
    PageOrientation

    PaperSize

    Gets or sets the paper size.

    Declaration
    public PaperSize PaperSize { get; set; }
    Property Value
    Type Description
    PaperSize

    RightMargin

    Gets or sets the margin size at the right of the page in twips.

    Declaration
    public double RightMargin { get; set; }
    Property Value
    Type Description
    System.Double

    TopMargin

    Gets or sets the margin size at the top of the page in twips.

    Declaration
    public double TopMargin { get; set; }
    Property Value
    Type Description
    System.Double

    Methods

    GetBottomMargin(MeasurementUnit)

    Gets the bottom margin of the document page.

    Declaration
    public double GetBottomMargin(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the bottom margin.

    Returns
    Type Description
    System.Double

    The bottom margin of the document page in the specified measurement unit.

    GetFooterHeight(MeasurementUnit)

    Gets the footer height of the document page.

    Declaration
    public double GetFooterHeight(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the footer height.

    Returns
    Type Description
    System.Double

    The footer height of the document page in the specified measurement unit.

    GetGutter(MeasurementUnit)

    Gets the gutter size of the document page.

    Declaration
    public double GetGutter(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the gutter size.

    Returns
    Type Description
    System.Double

    The gutter size of the document page in the specified measurement unit.

    GetHeaderHeight(MeasurementUnit)

    Gets the header height of the document page.

    Declaration
    public double GetHeaderHeight(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the header height.

    Returns
    Type Description
    System.Double

    The header height of the document page in the specified measurement unit.

    GetHeight(MeasurementUnit)

    Gets the height of the document page.

    Declaration
    public double GetHeight(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the height.

    Returns
    Type Description
    System.Double

    The height of the document page in the specified measurement unit.

    GetLeftMargin(MeasurementUnit)

    Gets the left margin of the document page.

    Declaration
    public double GetLeftMargin(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the left margin.

    Returns
    Type Description
    System.Double

    The left margin of the document page in the specified measurement unit.

    GetRightMargin(MeasurementUnit)

    Gets the right margin of the document page.

    Declaration
    public double GetRightMargin(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the right margin.

    Returns
    Type Description
    System.Double

    The right margin of the document page in the specified measurement unit.

    GetTopMargin(MeasurementUnit)

    Gets the top margin of the document page.

    Declaration
    public double GetTopMargin(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the top margin.

    Returns
    Type Description
    System.Double

    The top margin of the document page in the specified measurement unit.

    GetWidth(MeasurementUnit)

    Gets the width of the document page.

    Declaration
    public double GetWidth(MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    MeasurementUnit measurementUnit

    The desired unit of measurement for the width.

    Returns
    Type Description
    System.Double

    The width of the document page in the specified measurement unit.

    SetBottomMargin(Double, MeasurementUnit)

    Sets the bottom margin for the document.

    Declaration
    public void SetBottomMargin(double bottomMargin, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Double bottomMargin

    The size of the bottom margin.

    MeasurementUnit measurementUnit

    The unit of measurement for the bottom margin size.

    Remarks

    Use this method to set the size of the bottom margin for the document.

    SetCustomPaperSize(Double, Double, MeasurementUnit)

    Sets a custom paper size for the document.

    Declaration
    public void SetCustomPaperSize(double width, double height, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Double width

    The width of the custom paper size.

    System.Double height

    The height of the custom paper size.

    MeasurementUnit measurementUnit

    The unit of measurement for the custom paper size dimensions.

    Remarks

    Use this method to set a custom paper size for the document. The width and height must be positive values, otherwise, an System.ArgumentOutOfRangeException is thrown.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown if the width or height is a negative value.

    SetCustomPaperSize(Int32, Int32)

    Sets a custom paper size for the document.

    Declaration
    public void SetCustomPaperSize(int width, int height)
    Parameters
    Type Name Description
    System.Int32 width

    The width of the custom paper size in twips.

    System.Int32 height

    The height of the custom paper size in twips.

    Remarks

    Use this method to set a custom paper size for the document. The width and height must be positive values, otherwise, an System.ArgumentOutOfRangeException is thrown.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown if the width or height is a negative value.

    SetFooterHeight(Double, MeasurementUnit)

    Sets the footer height for the document.

    Declaration
    public void SetFooterHeight(double footerHeight, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Double footerHeight

    The size of the footer height .

    MeasurementUnit measurementUnit

    The unit of measurement for the footer height size.

    Remarks

    Use this method to set the size of the footer height for the document.

    SetGutter(Int32, MeasurementUnit)

    Sets the gutter size for the document.

    Declaration
    public void SetGutter(int gutter, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Int32 gutter

    The size of the gutter.

    MeasurementUnit measurementUnit

    The unit of measurement for the gutter size.

    Remarks

    The gutter size is used to specify additional space on the right margin. It is typically used for binding purposes in printed documents.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown if the provided gutter size is negative.

    SetHeaderHeight(Int32, MeasurementUnit)

    Sets the header height for the document.

    Declaration
    public void SetHeaderHeight(int headerHeight, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Int32 headerHeight

    The size of the header height.

    MeasurementUnit measurementUnit

    The unit of measurement for the header height size.

    Remarks

    Use this method to set the size of the header height for the document.

    SetLeftMargin(Int32, MeasurementUnit)

    Sets the left margin for the document.

    Declaration
    public void SetLeftMargin(int leftMargin, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Int32 leftMargin

    The size of the left margin.

    MeasurementUnit measurementUnit

    The unit of measurement for the left margin size.

    Remarks

    Use this method to set the size of the left margin for the document.

    SetRightMargin(Double, MeasurementUnit)

    Sets the right margin for the document.

    Declaration
    public void SetRightMargin(double rightMargin, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Double rightMargin

    The size of the right margin.

    MeasurementUnit measurementUnit

    The unit of measurement for the right margin size.

    Remarks

    Use this method to set the size of the right margin for the document.

    SetTopMargin(Double, MeasurementUnit)

    Sets the top margin for the document.

    Declaration
    public void SetTopMargin(double topMargin, MeasurementUnit measurementUnit)
    Parameters
    Type Name Description
    System.Double topMargin

    The size of the top margin.

    MeasurementUnit measurementUnit

    The unit of measurement for the top margin size.

    Remarks

    Use this method to set the size of the top margin for the document.

    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet
    IronWord_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronWord