Skip to main content

DocumentBackground

Import from @reductoai/docx/officejs.

DocumentBackground properties

DocumentBackgroundFill

The background’s fill, named as Word.ShapeFill names its members. Import from @reductoai/docx/officejs.

DocumentBackgroundFill properties

DocumentBackgroundFill.clear()

Remove the page colour.

DocumentBackgroundFill.setSolidColor()

HeaderFooter

Import from @reductoai/docx/node, @reductoai/docx/officejs.

HeaderFooter properties

HeaderFooter.clear()

Remove all content, leaving one empty styled paragraph.

HeaderFooter.detach()

Clone a shared/inherited part so subsequent edits affect only this section.

HeaderFooter.getContentControls()

Same option semantics as Body.getContentControls, over the part’s own story.

HeaderFooter.getHtml()

As Word: tables as <table> (merges as colspan/rowspan), <h1>-<h6> for headings, list markers as text, b/i/u/s/sup/sub and links inline.

HeaderFooter.getOoxml()

Raw WML; a pkg:package with its pictures and links when it uses any, so another part can take it.

HeaderFooter.getRange()

A collapsed range at the part’s “Start” or “End”. Ranges span a single paragraph, so spans come from search or paragraph.getRange().

HeaderFooter.getReviewedText()

The part’s own w:ins/w:del projection; the walker is element-driven, so it aligns.

HeaderFooter.getTrackedChanges()

The tracked changes in this part’s own story.

HeaderFooter.insertContentControl()

Wrap the whole part, as Body does its story; partial wraps go through a range.

HeaderFooter.insertFileFromBase64()

Insert a .docx’s body at the part’s edge or in its place; async, the file is unpacked here.

HeaderFooter.insertInlinePictureFromBase64()

HeaderFooter.insertOoxml()

Insert a WML fragment (what getOoxml returns) or a Word pkg:package at the part’s edge; “Replace” swaps the whole part. A blank edge paragraph gives way unless the payload ends in a table, which a part cannot end with.

HeaderFooter.insertPageNumber()

Append a page-number paragraph; “{page}”/“{pages}” in the template become live PAGE/NUMPAGES fields (e.g. “Page {page} of {pages}”). Centered by default. A template with a tab is left-aligned: its first “\t” is an alignment tab to the center of the margins and its second one to the right margin, so the pieces follow the page setup and not the tab stops of the style.

HeaderFooter.insertParagraph()

Append, prepend, or replace a whole paragraph in the Header/Footer style.

HeaderFooter.insertTable()

Insert a table at the start or end of this part; values fills cells row-major.

HeaderFooter.insertText()

Insert text: “Start”/“End” prepend/append a run to the boundary paragraph; “Replace” swaps the whole part for one paragraph. “\t” and “\n” become real tab/break elements.
Literal search across this part’s paragraphs; hits are live Range handles.

HeaderFooter.set()

Not implemented. These Office.js members throw: lists, parentBody, parentContentControl, style, styleBuiltIn, getComments, insertBreak, insertHtml, select.

LineNumbering

Line numbers in the margin, off when w:lnNumType is absent or counts by 0. As in Word, turning them off keeps the start, distance and restart (on a w:countBy="0" element) for when they come back on; those stay writable while off, and countBy then reads 1 and ignores a write. Import from @reductoai/docx/officejs.

LineNumbering properties

LineNumbering.set()

isActive is applied first, so one batch can switch numbering on and shape it.

PageBorder

One edge of a section’s page border. Import from @reductoai/docx/officejs.

PageBorder properties

PageBorder.set()

PageBorderCollection

A section’s page border. Import from @reductoai/docx/officejs.

PageBorderCollection properties

PageBorderCollection.applyPageBordersToAllSections()

Copies this section’s page border to every section; none here clears them all.

PageBorderCollection.set()

SectionCollection

OfficeJS-flavored live collection: items is recomputed on every access. Import from @reductoai/docx/node, @reductoai/docx/officejs.

SectionCollection properties

SectionCollection.at()

SectionCollection.getFirst()

SectionCollection.getFirstOrNullObject()

OfficeJS null-object variant; inspect isNullObject before other members.

SectionCollection.getItem()

OfficeJS spelling of at().

SectionCollection.getLast()

SectionCollection.getLastOrNullObject()

OfficeJS null-object variant; inspect isNullObject before other members.

SectionPageSetup

Raw w:pgSz/w:pgMar reads and writes, in points — DECLARED values, not laid geometry. The nominal vertical budget for body content is pageHeight - bottomMargin; the laid per-page text-area box comes from document.layout.getRects(section), whose rects carry basis: "textArea". Content that stops short of that bottom usually hit an explicit break (Paragraph.hasPageBreak), not the margin. Not exported by name. You get it from the API.

SectionPageSetup properties

SectionPageSetup.set()

TextColumn

Not exported by name. You get it from the API.

TextColumn properties

TextColumn.set()

TextColumnCollection

Not exported by name. You get it from the API.

TextColumnCollection properties

TextColumnCollection.add()

Appends a column. Evenly spaced (the default) raises @w:num and, with spacing, sets the shared gap; otherwise the grid turns explicit and the new column takes width (-1 or absent: the last column’s) and the column before it takes spacing as its gap.

TextColumnCollection.getFlowDirection()

Word ties the column flow to the section’s reading order (w:sectPr/w:bidi).

TextColumnCollection.getHasLineBetween()

TextColumnCollection.getIsEvenlySpaced()

TextColumnCollection.setCount()

Arranges the section into numColumns evenly spaced columns; 1 is a single column.

TextColumnCollection.setFlowDirection()

TextColumnCollection.setHasLineBetween()

TextColumnCollection.setIsEvenlySpaced()

True drops the explicit widths; false writes the current equal split as explicit columns.