Concepts

Page Sizes

Pages sizes can be set to custom measurements or from a collection of standard presets.

Usage

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 => {/* ... */});

Presets

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.
});