The page/paper size in a section can be set using exact measurements or from a collection of standard presets:
document.Section(section =>
{
section.PageSize(8.5, 11); // inches, or
section.PageSize(21.59f, 27.94f, Unit.Centimeter); // or
section.PageSize(PageSizes.Letter);
});
The page size is applied to the next section unless specified otherwise. For example, in the following code the first two sections would have a page size of Letter (8.5" x 11") while the last two sections would have a page size of Tabloid (11" x 17").
// Page size is Letter (8.5" x 11") by default:
document.Section(section => {/* ... */})
// Page size is implicitly Letter, matching the previous section:
document.Section(section => {/* ... */})
// Page size is explicitly set to Tabloid (11" x 17"):
document.Section(section => section.PageSize(PageSize.Tabloid))
// Page size is implicitly Tabloid, matching the previous section:
document.Section(section => {/* ... */});
For convenience, FluentWriter provides presets for commonly used page size and methods for changing their orientation:
using FluentWriter.Common.Helpers;
document.Section(section =>
{
section.PageSize(PageSizes.A4);
section.PageSize(PageSizes.A3);
section.PageSize(PageSizes.Letter);
section.PageSize(PageSizes.Legal);
section.PageSize(PageSizes.Tabloid.Landscape()) // 👈 Setting orientation.
});
North American (U.S.) Named Paper Sizes:
| Size | Width × Height |
|---|---|
| PageSizes.Letter | 8.5 x 11 in |
| PageSizes.Legal | 8.5 x 14 in |
| PageSizes.Ledger | 17 x 11 in |
| PageSizes.Tabloid | 11 x 17 in |
| PageSizes.Executive | 7 x 10 in |
| PageSizes.Postcard | 6 x 4 in |
North American Architectural Series:
| Size | Width × Height |
|---|---|
| PageSizes.ARCH_A | 9 x 12 in |
| PageSizes.ARCH_B | 12 x 18 in |
| PageSizes.ARCH_C | 18 x 24 in |
| PageSizes.ARCH_D | 24 x 36 in |
| PageSizes.ARCH_E | 36 x 48 in |
| PageSizes.ARCH_E1 | 30 x 42 in |
| PageSizes.ARCH_E2 | 26 x 38 in |
| PageSizes.ARCH_E3 | 27 x 39 in |
American National Standards Institute (ANSI) Y14.1 Paper Sizes:
| Size | Width × Height |
|---|---|
| PageSizes.ANSI_A | 8.5 x 11 in |
| PageSizes.ANSI_B | 11 x 17 in |
| PageSizes.ANSI_C | 17 x 22 in |
| PageSizes.ANSI_D | 22 x 34 in |
| PageSizes.ANSI_E | 34 x 44 in |
International Standards Organization (ISO) 216 A Series Paper Sizes:
| Size | Width × Height |
|---|---|
| PageSizes.A0 | 841 x 1189 mm |
| PageSizes.A1 | 594 x 841 mm |
| PageSizes.A2 | 420 x 594 mm |
| PageSizes.A3 | 297 x 420 mm |
| PageSizes.A4 | 210 x 297 mm |
| PageSizes.A5 | 148 x 210 mm |
| PageSizes.A6 | 105 x 148 mm |
| PageSizes.A7 | 74 x 105 mm |
| PageSizes.A8 | 52 x 74 mm |
| PageSizes.A9 | 37 x 52 mm |
| PageSizes.A10 | 26 x 37 mm |