VDocs.NET
Back to DOM

DOM.Elements.PageSize

Namespace: DOM.Elements

Describes the physical size of a page. Supports common named paper sizes (A4, A5, Letter, Legal) as well as custom sizes expressed using ainstance.

The class holds ainstance representing width and height (and units). Setting theproperty will update the storedto the canonical dimensions for that paper. Conversely, assigningattempts to map the provided dimensions back to a knownvalue; if no match is found thebecomes.

7 members

Constructors

PageSize

3 overloads
PageSize()

Initializes a new instance ofusing the default dimensions. The default value is A4 (8.27in × 11.69in).

PageSize(double width, double height, Units units)

Initializes a new instance ofwith a custom width and height using the specified units.

Parameters

width
Width value in the provided.
height
Height value in the provided.
units
Units used forand.
PageSize(PaperSize paper)

Initializes a new instance ofusing a predefined.

Parameters

paper
Named paper size to use (A4, A5, Letter, Legal or Custom).

Properties

CustomSizeDimensions

Gets or sets the custom page dimensions.

Assigning ainstance updates the internal measurements and will attempt to recognize the dimensions as one of the knownvalues by comparing the width/height in inches against canonical values: - A4 = 8.27in × 11.69in - A5 = 5.83in × 8.27in - Letter = 8.5in × 11in - Legal = 8.5in × 14in If an exact match is not found the is set to. Note: the comparison is an exact numeric comparison of the inch values as implemented.

dimensions

Internal storage for the current dimensions. Defaults to A4 dimensions (8.27in × 11.69in).

paper

Backing field for theproperty.

Paper

Gets or sets the named paper size.

When set to a known paper size (A4, A5, Letter, Legal) the is updated to the canonical dimensions for that paper (values stored in inches). Setting towill not change.

VDocs.NET
The .NET Word Document Library

Generate Word
documents.
Not XML.

Create professional documents in .NET without the complexity of OpenXML or Word Interop.

C#VB.NET
var doc = new WordDocument();

doc.AddParagraph()
   .AddText("Invoice")
   .SetHeading(HeadingLevel.Title);

doc.Save("invoice.docx");

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or
Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.