ReferenceSections

Sections operations

Section structure and page-setup operations.

18 operations. Names, descriptions, and behavior flags come from the canonical contract.

Operations

sections.clearHeaderFooterRefClear a section header/footer reference for a specific variant.mutatessections.clearPageBordersClear page border configuration for a section.mutatestrackedsections.getRetrieve full section information by section address. In V2, sections with invalid page geometry raise PRECONDITION_FAILED. Use sections.list to find the section address and correct its geometry.readsections.listList sections in deterministic order with section-target handles.readsections.setBreakTypeSet the section break type.mutatestrackedsections.setColumnsSet column configuration for a section.mutatestrackedsections.setHeaderFooterMarginsSet header/footer margin distances for a section.mutatestrackedsections.setHeaderFooterRefSet or replace a section header/footer reference for a variant.mutatessections.setLineNumberingEnable, configure, or disable line numbering for a section. Enabling with no countBy stores 1. The start value is the stored Word offset. At a restart, start: 1 makes the first eligible line number 2. The distance is in inches. Omitting distance or setting it to zero uses automatic placement. Mounted SuperDoc v2 print layout shows multiples of countBy on eligible body lines and approximates automatic spacing from the physical columns. Section reads can report enabled for imported numbering markup that has no positive integer countBy. Those settings produce no labels.mutatestrackedsections.setLinkToPreviousSet or clear link-to-previous behavior for a header/footer variant.mutatessections.setOddEvenHeadersFootersEnable or disable odd/even header-footer mode in document settings.mutatessections.setPageBordersSet page border configuration for a section.mutatestrackedsections.setPageMarginsSet page-edge margins in inches (1 inch = 1440 twips). Omitted margins keep their current values. In V2, usable page width and height must both stay positive after rounding to twips. Gutter counts toward the horizontal margins unless document settings place it at the top. To recover existing invalid margins, supply all needed corrections together.mutatestrackedsections.setPageNumberingSet page numbering format/start and chapter numbering settings for a section.mutatestrackedsections.setPageSetupSet page size/orientation properties for a section. Changing orientation writes only the page size: width and height swap so the long side matches the orientation, unless width or height is given. Page margins stay as they are; to change them with the orientation, call sections.setPageMargins. Portrait is written without an orient attribute, as Word does. No named paper sizes are defined, so a paperSize other than the paper code the section already has (as sections.get reports it) is rejected with INVALID_INPUT; set width and height instead. In V2, the resulting page size must leave positive area with the current margins.mutatestrackedsections.setSectionDirectionSet section text flow direction (LTR/RTL).mutatestrackedsections.setTitlePageEnable or disable title-page behavior for a section.mutatestrackedsections.setVerticalAlignSet vertical page alignment for a section.mutatestracked