Skip to content
Document Authoring DA  API Docs v2.1.0
npmGitHub

TextColumnsNEW

TextColumns:

type TextColumns =
| { type: "equal"; count: number; spacing: number; separator: boolean }
| { type: "custom"; columns: TextColumn[]; separator: boolean };

The text columns of a section.

{ type: "equal"; count: number; spacing: number; separator: boolean; }

type: "equal"

count: number

The number of columns, an integer from 1 to 45.

spacing: number

The space between two adjacent columns, in points.

separator: boolean

Whether a vertical line separates adjacent columns.

{ type: "custom"; columns: TextColumn[]; separator: boolean; }

type: "custom"

columns: TextColumn[]

Between 1 and 45 columns, from left to right.

separator: boolean

Whether a vertical line separates adjacent columns.

Text fills a section’s first column from top to bottom, then the column to its right. 'equal' columns are count columns of the same width. 'custom' columns list each column with its own width. All values are in points (1 point = 1/72 inch).

Each 'equal' column is (textWidth - spacing * (count - 1)) / count wide, where textWidth is the page width minus the left and right page margins. A section without columns has one 'equal' column.

PageSetup.textColumns reads a section’s columns, and PageSetup.setTextColumns changes them.

Two columns of the same width, half an inch apart, with a line between them:

section.pageSetup().setTextColumns({ type: 'equal', count: 2, spacing: 36, separator: true });

A narrow and a wide column that fill the 468-point text width of a US Letter page with 1-inch margins:

section.pageSetup().setTextColumns({
type: 'custom',
columns: [
{ width: 144, spaceAfter: 36 },
{ width: 288, spaceAfter: 0 },
],
separator: false,
});