Skip to content
Document Authoring DA  API Docs v1.10.0
npmGitHub

PageSetup

PageSetup:

Controls physical page properties for a section.

PageSetup provides methods to configure and query the physical page dimensions and margins for a section. Each section can have its own page setup, allowing different parts of a document to use different page sizes or orientations.

Page setup is accessed via Section.pageSetup and includes:

  • Page size (width and height)
  • Page margins (top, bottom, left, right)

Change to landscape orientation:

const pageSetup = section.pageSetup();
const currentSize = pageSetup.pageSize();
// Swap width and height for landscape
pageSetup.setPageSize({
width: currentSize.height,
height: currentSize.width
});

setPageSize(size): void

Sets the page size for this section.

Partial<PageSize>

Partial page size with width and/or height to set

void

All dimensions are in points (1 point = 1/72 inch).

To change orientation, swap the width and height values.


setPageMargins(margins): void

Sets the page margins for this section.

Partial<PageMargins>

Partial page margins with top, bottom, left, and/or right to set

void

All dimensions are in points (1 point = 1/72 inch).


pageSize(): PageSize

Gets the current page size for this section.

PageSize

The current PageSize with width and height

All dimensions are in points (1 point = 1/72 inch).


pageMargins(): PageMargins

Gets the current page margins for this section.

PageMargins

The current PageMargins with top, bottom, left, and right

All dimensions are in points (1 point = 1/72 inch).