Table of Contents

Class PaperSizes

Namespace
Alternet.Drawing.Printing
Assembly
Alternet.UI.Common.dll

Provides a collection of predefined paper sizes for standard international (ISO) and North American formats, supporting both millimeter and inch units.

public class PaperSizes
Inheritance
PaperSizes

Remarks

The PaperSizes class offers convenient access to a wide range of commonly used paper sizes, including A, B, and C series, as well as US-specific formats such as Letter, Legal, and Tabloid. It enables applications to retrieve, customize, and transform paper size definitions for use in printing, layout, or document formatting scenarios. Static properties are available for accessing standard sets of sizes in millimeters or inches, and instance members allow for further customization or extension as needed.

Properties

A0

Gets or sets paper size for the "A0" format.

A0x2

Gets or sets paper size for the "2A0" format.

A0x4

Gets or sets paper size for the "4A0" format.

A1

Gets or sets paper size for the "A1" format.

A10

Gets or sets paper size for the "A10" format.

A2

Gets or sets paper size for the "A2" format.

A3

Gets or sets paper size for the "A3" format.

A4

Gets or sets paper size for the "A4" format.

A4InDips

Gets A4 paper size in device-independent units.

A5

Gets or sets paper size for the "A5" format.

A5InDips

Gets A5 paper size in device-independent units.

A6

Gets or sets paper size for the "A6" format.

A6InDips

Gets A6 paper size in device-independent units.

A7

Gets or sets paper size for the "A7" format.

A8

Gets or sets paper size for the "A8" format.

A9

Gets or sets paper size for the "A9" format.

B0

Gets or sets paper size for the "B0" format.

B1

Gets or sets paper size for the "B1" format.

B10

Gets or sets paper size for the "B10" format.

B2

Gets or sets paper size for the "B2" format.

B3

Gets or sets paper size for the "B3" format.

B4

Gets or sets paper size for the "B4" format.

B5

Gets or sets paper size for the "B5" format.

B6

Gets or sets paper size for the "B6" format.

B7

Gets or sets paper size for the "B7" format.

B8

Gets or sets paper size for the "B8" format.

B9

Gets or sets paper size for the "B9" format.

C0

Gets or sets paper size for the "C0" format.

C1

Gets or sets paper size for the "C1" format.

C10

Gets or sets paper size for the "C10" format.

C2

Gets or sets paper size for the "C2" format.

C3

Gets or sets paper size for the "C3" format.

C4

Gets or sets paper size for the "C4" format.

C5

Gets or sets paper size for the "C5" format.

C6

Gets or sets paper size for the "C6" format.

C7

Gets or sets paper size for the "C7" format.

C8

Gets or sets paper size for the "C8" format.

C9

Gets or sets paper size for the "C9" format.

DefaultInchesDecimals

Gets or sets the default number of decimal places used when representing inch measurements. This value is used in methods that convert millimeters to inches or when formatting inch-based sizes for display. Adjusting this value allows you to control the precision of inch measurements across the application, ensuring that they are displayed with the desired number of decimal places for clarity and consistency.

GovernmentLegal

Gets or sets paper size for the "Government Legal" format.

GovernmentLetter

Gets or sets paper size for the "Government Letter" format.

HalfLetter

Gets or sets paper size for the "Half Letter" format.

JuniorLegal

Gets or sets paper size for the "Junior Legal" format.

Legal

Gets or sets paper size for the "Legal" format.

Letter

Gets or sets paper size for the "Letter" format.

SizeInches

Gets or sets paper sizes (inches).

SizeInchesRounded

Gets or sets the paper sizes with dimensions rounded to the specific number of decimal places which is determined by the DefaultInchesDecimals property.

SizeMillimeters

Gets or sets paper sizes (millimeters).

Tabloid

Gets or sets paper size for the "Tabloid" format.

Methods

Assign(PaperSizes, Func<SizeD, SizeD>?)

Copies all paper sizes from the specified instance, optionally applying a transformation to each size before assignment.

CreateSizeInches()

Creates a new instance of the PaperSizes class with dimensions specified in inches.

CreateSizeInchesRounded()

Creates a new instance of the PaperSizes class with standard ISO and US paper sizes defined in inches. This method converts the standard millimeter sizes to inches using the (MmToInches(float, int)) method, applying rounding to the specified number of decimal places for inch measurements DefaultInchesDecimals .

CreateSizeMillimeters()

Creates a new instance of the PaperSizes class with standard international and North American paper sizes defined in millimeters.

GetSize(KnownPaperKind)

Returns the dimensions of the specified standard paper type.

Log()

Logs the available paper sizes in both millimeters and inches.

Log(string?, ILogWriter?)

Logs the sizes of all known paper kinds to the specified log writer.

MmToInches(float)

Converts a measurement from millimeters to the equivalent value in inches.

MmToInches(float, int)

Converts a measurement from millimeters to inches and rounds the result to the specified number of decimal places.

SetSize(KnownPaperKind, SizeD, Func<SizeD, SizeD>?)

Sets the size for the specified known paper kind.

Transform(Func<SizeD, SizeD>)

Applies a transformation function to the sizes of all known paper kinds.