Editra documentation

Page control

Use fixed Word-compatible paper sizes and automatic page flow that stays aligned with browser print and PDF output.

Standard Word page dimensions

In the Word theme, every sheet uses a physical industry-standard size. A4 is exactly 210mm × 297mm and Letter is exactly 8.5in × 11in. Portrait and landscape are supported, while arbitrary width and height controls remain available only in the flexible Classic theme.

const editor = await Editra.init({
  selector: "#editra-editor",
  pageSize: "A4",
  orientation: "portrait",
  margins: { top: "1in", right: "1in", bottom: "1in", left: "1in" }
});

Open page-size demo →

Complete sheets: Page 2 and every later page keep the same full physical height as Page 1, even when a page contains only one line.

Headers and footers

Apply text, date/time, fields, and page numbering consistently across generated pages.

editor.executeCommand("insertHeader", { text: "Project brief", pageNumber: true });
editor.executeCommand("insertFooter", { text: "Confidential", dateTime: true });

Open header/footer demo →

Ruler and margins

The horizontal ruler exposes draggable margin and indent markers plus clickable tab stops. Adjustments feed document state and exported layout.

Ruler demo · Margins demo

Native page flow

Keep typing and press Enter normally. When content reaches the writable boundary of Page 1, the next line begins inside Page 2 automatically. Editra's rendering layer supplies the visual separation; stored HTML remains ordinary flowing paragraphs without automatic page wrappers, spacer elements, or manual break tags.

Open native A4 page-flow demo →

Pagination rules

Keep media and form blocks intact, control paragraph and code splitting, repeat table headers, and choose whether rows or complete tables stay together.

Open pagination rules demo →