Readonlyval: Optional Readonlybottom?: stringOptional Readonlycolor?: stringOptional Readonlyfill?: stringOptional Readonlyfooter?: stringOptional Readonlygutter?: stringOptional Readonlyh?: stringOptional Readonlyheader?: stringOptional Readonlyleft?: stringOptional ReadonlylineOptional Readonlypos?: string | numberOptional Readonlyright?: stringOptional ReadonlyrsidR?: stringOptional ReadonlyrsidRPr?: stringOptional ReadonlyrsidOptional Readonlyspace?: stringOptional Readonlysz?: stringOptional Readonlytop?: stringOptional Readonlytype?: stringOptional Readonlyval?: string | number | booleanOptional Readonlyw?: stringAbstractAbstractAbstractAbstractprepAbstractAbstractprepAdds new section properties. Note: Previous section is created in paragraph after the current element, and then new section will be added. The spec says:
new section options
-Readonlychildren: readonly ParagraphChild[]Readonlyid: stringOptional Readonlyattributes?: AttributePayload<T>Optional Readonlychildren?: readonly XmlComponent[]Readonlyname: stringOptionaloptions: ICheckboxSymbolOptionsOptionaloptions: ICheckboxSymbolOptionsOptionalfont: stringOptionalfont: stringOptionaloptions: ICheckboxSymbolOptionsOptionaloptions: ICheckboxSymbolOptionsOptionalanchor: stringOptionalanchor: stringReadonlyinstanceReadonlynumReadonlyreferenceReadonlyinstanceReadonlynumReadonlyreferenceOptional Readonlycolor?: stringOptional ReadonlythemeOptional ReadonlythemeOptional ReadonlythemeOptionalcharSpace: numberOptionaltype: OptionalcharSpace: numberOptionaltype: "default" | "lines" | "linesAndChars" | "snapToChars"Readonlychildren: readonly ParagraphChild[]Readonlylink: stringReadonlyid: numberOptionalinitContent: XmlComponentOptionalinitContent: XmlComponentGridSpan element. Should be used in a table cell. Pass the number of columns that this cell need to span.
-GridSpan element. Should be used in a table cell. Pass the number of columns that this cell need to span.
+OptionalinitContent: XmlComponentOptionalinitContent: XmlComponentAbstractAbstractUsed for the attributes of root element that is being imported.
-Used for the attributes of root element that is being imported.
+Represents imported xml component from xml file.
-Represents imported xml component from xml file.
+Converts the xml string to a XmlComponent tree.
-Optional_attr: anyStaticfromConverts the xml string to a XmlComponent tree.
+fromConverts the xml string to a XmlComponent tree.
+Optional_attr: anyStaticfromConverts the xml string to a XmlComponent tree.
xml content of the imported component
-AbstractOptionalinitComponent: InitializableXmlComponentAbstractOptionalinitComponent: InitializableXmlComponentReadonlyanchor: stringReadonlychildren: readonly ParagraphChild[]Optionalstart: numberOptionalstart: numberReadonlychildren: readonly MathComponent[]Readonlychildren: readonly MathComponent[]Optionalchildren: readonly MathComponent[]Optionalchildren: readonly MathComponent[]Optionalvalue: stringOptionalvalue: stringOptionallimitLocationVal: stringOptionallimitLocationVal: stringReadonlychildren: readonly MathComponent[]Readonlychildren: readonly MathComponent[]StatictoOptionalprettify: StatictoOptionalprettify: StatictoOptionalprettify: StatictoOptionalprettify: StatictoOptionalprettify: Optionaloptions: IPageBordersOptionsOptionaloptions: IPageBordersOptionsAdd page break before the paragraph if there is no one added before.
-Add page break before the paragraph if there is no one added before.
+Optionaloptions: IParagraphPropertiesOptionsOptionaloptions: IParagraphPropertiesOptionsOptionaloptions: IParagraphStylePropertiesOptionsOptionaloptions: IParagraphStylePropertiesOptionsOptionalhint: stringOptionalhint: stringOptionaloptions: IRunPropertiesOptionsOptionaloptions: IRunPropertiesOptionsOptionaloptions: IRunStylePropertiesOptionsOptionaloptions: IRunStylePropertiesOptionsReadonlyval: OptionalcachedValue: stringOptionalcachedValue: stringText Direction within a table cell
-Text Direction within a table cell
+Optional Readonlyleader?: Readonlypos: string | numberReadonlyval: Static ReadonlyNONEStatic ReadonlyNONEOptionalproperties: ITableOfContentsOptionsOptionalproperties: ITableOfContentsOptionsReadonlyrule: "auto" | "atLeast" | "exact"Readonlyvalue: string | numberOptionalcolor: stringOptionalcolor: stringOptional ReadonlyverticalVertical merge element. Should be used in a table cell.
-Vertical merge element. Should be used in a table cell.
+AbstractAbstractAbstractAbstractConverts the given xml element (in json format) into XmlComponent.
-the xml element in json presentation
-Converts the given xml element (in json format) into XmlComponent.
+the xml element in json presentation
++
@@ -14,7 +14,7 @@
Here are examples of docx being used with basic HTML/JS in a browser environment:
Here are examples of docx being used with basic HTML/JS in a browser environment:
Press endpoint on the RunKit website:
Press endpoint on the RunKit website:

More here
-Please refer to the documentation at https://docx.js.org/ for details on how to use this library, examples and much more!
-Check the demo folder for examples.
-Read the contribution guidelines here.
-Please refer to the documentation at https://docx.js.org/ for details on how to use this library, examples and much more!
+Check the demo folder for examples.
+Read the contribution guidelines here.
+Made with 💖
-Optional Readonlycolor?: stringBorder color, in hex (eg 'FF00AA')
-Optional Readonlysize?: numberSize of the border in 1/8 pt
-Optional Readonlyspace?: numberSpacing offset. Values are specified in pt
-Readonlystyle: typeof BorderStyle[keyof typeof BorderStyle]Optional Readonlycolor?: stringBorder color, in hex (eg 'FF00AA')
+Optional Readonlysize?: numberSize of the border in 1/8 pt
+Optional Readonlyspace?: numberSpacing offset. Values are specified in pt
+Readonlystyle: typeof BorderStyle[keyof typeof BorderStyle]Optional Readonlyalignment?: typeof AlignmentType[keyof typeof AlignmentType]Optional ReadonlycontextualOptional Readonlyindent?: IIndentAttributesPropertiesOptional ReadonlykeepSpecifies that all lines of the paragraph are to be kept on a single page when possible.
-Optional ReadonlykeepSpecifies that the paragraph (or at least part of it) should be rendered on the same page as the next paragraph when possible. If multiple paragraphs are to be kept together but they exceed a page, then the set of paragraphs begin on a new page and page breaks are used thereafter as needed.
-Optional ReadonlyleftOptional ReadonlyoutlineOptional ReadonlyrightOptional Readonlyspacing?: ISpacingPropertiesOptional ReadonlythematicOptional Readonlyalignment?: typeof AlignmentType[keyof typeof AlignmentType]Optional ReadonlycontextualSpacing?: booleanOptional Readonlyindent?: IIndentAttributesPropertiesOptional ReadonlykeepLines?: booleanSpecifies that all lines of the paragraph are to be kept on a single page when possible.
+Optional ReadonlykeepNext?: booleanSpecifies that the paragraph (or at least part of it) should be rendered on the same page as the next paragraph when possible. If multiple paragraphs are to be kept together but they exceed a page, then the set of paragraphs begin on a new page and page breaks are used thereafter as needed.
+Optional ReadonlyleftTabStop?: numberOptional ReadonlyoutlineLevel?: numberOptional ReadonlyrightTabStop?: numberOptional Readonlyspacing?: ISpacingPropertiesOptional ReadonlythematicBreak?: booleanOptional Readonlyhyperlink?: boolean\h option - Creates a hyperlink to the bookmarked paragraph.
-Optional Readonlyuse\p option - Causes the field to display its position relative to the source +
Optional Readonlyhyperlink?: boolean\h option - Creates a hyperlink to the bookmarked paragraph.
+Optional ReadonlyuseRelativePosition?: boolean\p option - Causes the field to display its position relative to the source bookmark. If the PAGEREF field is on the same page as the bookmark, it omits "on page #" and returns "above" or "below" only. If the PAGEREF field is not on the same page as the bookmark, the string "on page #" is used.
-Optional ReadonlyautoThis element specifies whether inter-character spacing shall automatically be adjusted between regions of numbers and regions of East Asian text in the current paragraph. These regions shall be determined by the Unicode character values of the text content within the paragraph. +
Optional ReadonlyautoSpaceEastAsianText?: booleanThis element specifies whether inter-character spacing shall automatically be adjusted between regions of numbers and regions of East Asian text in the current paragraph. These regions shall be determined by the Unicode character values of the text content within the paragraph. This only works in Microsoft Word. It is not part of the ECMA-376 OOXML standard.
-Optional Readonlybidirectional?: booleanOptional Readonlyborder?: IBordersOptionsOptional Readonlybullet?: { Readonlylevel: numberOptional Readonlyframe?: IFrameOptionsOptional Readonlyheading?: typeof HeadingLevel[keyof typeof HeadingLevel]Optional ReadonlyoverflowOptional ReadonlypageOptional Readonlyrun?: IRunOptionsReference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.1.29.
-Optional Readonlyscale?: numberOptional Readonlyshading?: IShadingAttributesPropertiesOptional Readonlystyle?: stringOptional ReadonlysuppressOptional ReadonlytabOptional ReadonlywidowOptional ReadonlywordOptional Readonlybidirectional?: booleanOptional Readonlyborder?: IBordersOptionsOptional Readonlybullet?: { level: number }Optional Readonlyframe?: IFrameOptionsOptional Readonlyheading?: typeof HeadingLevel[keyof typeof HeadingLevel]Optional ReadonlyoverflowPunctuation?: booleanOptional ReadonlypageBreakBefore?: booleanOptional Readonlyrun?: IRunOptionsReference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.1.29.
+Optional Readonlyscale?: numberOptional Readonlyshading?: IShadingAttributesPropertiesOptional Readonlystyle?: stringOptional ReadonlysuppressLineNumbers?: booleanOptional ReadonlytabStops?: readonly TabStopDefinition[]Optional ReadonlywidowControl?: booleanOptional ReadonlywordWrap?: booleanOptional ReadonlyabsoluteSpecifies an absolute horizontal position for the table, relative to the horizontalAnchor. +
Optional ReadonlyabsoluteHorizontalPosition?: number | UniversalMeasureSpecifies an absolute horizontal position for the table, relative to the horizontalAnchor. The value is in twentieths of a point. Note that the value can be negative, in which case the table is positioned before the anchor object in the direction of horizontal text flow. If relativeHorizontalPosition is also specified, then the absoluteHorizontalPosition attribute is ignored. If the attribute is omitted, the value is assumed to be zero.
-Optional ReadonlyabsoluteSpecifies an absolute vertical position for the table, relative to the verticalAnchor anchor. +
Optional ReadonlyabsoluteVerticalPosition?: number | UniversalMeasureSpecifies an absolute vertical position for the table, relative to the verticalAnchor anchor. The value is in twentieths of a point. Note that the value can be negative, in which case the table is positioned before the anchor object in the direction of vertical text flow. If relativeVerticalPosition is also specified, then the absoluteVerticalPosition attribute is ignored. If the attribute is omitted, the value is assumed to be zero.
-Optional ReadonlybottomSpecifies the minimum distance to be maintained between the table and the top of text in the paragraph +
Optional ReadonlybottomFromText?: number | PositiveUniversalMeasureSpecifies the minimum distance to be maintained between the table and the top of text in the paragraph below the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
-Optional ReadonlyhorizontalSpecifies the horizontal anchor or the base object from which the horizontal positioning in the +
Optional ReadonlyhorizontalAnchor?: typeof TableAnchorType[keyof typeof TableAnchorType]Specifies the horizontal anchor or the base object from which the horizontal positioning in the tblpX or tblpXSpec attribute should be determined. margin - relative to the vertical edge of the text margin before any text runs (left edge for left-to-right paragraphs) page - relative to the vertical edge of the page before any text runs (left edge for left-to-right paragraphs) text - relative to the vertical edge of the text margin for the column in which the anchor paragraph is located If omitted, the value is assumed to be page.
-Optional ReadonlyleftSpecifies the minimum distance to be maintained between the table and the edge of text in the paragraph +
Optional ReadonlyleftFromText?: number | PositiveUniversalMeasureSpecifies the minimum distance to be maintained between the table and the edge of text in the paragraph to the left of the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
-Optional Readonlyoverlap?: typeof OverlapType[keyof typeof OverlapType]Optional ReadonlyrelativeSpecifies a relative horizontal position for the table, relative to the horizontalAnchor attribute. +
Optional Readonlyoverlap?: typeof OverlapType[keyof typeof OverlapType]Optional ReadonlyrelativeHorizontalPosition?: typeof RelativeHorizontalPosition[keyof typeof RelativeHorizontalPosition]Specifies a relative horizontal position for the table, relative to the horizontalAnchor attribute. This will supersede the absoluteHorizontalPosition attribute. Possible values are: center - the table should be horizontally centered with respect to the anchor @@ -26,7 +26,7 @@ inside - the table should be inside of the anchor left - the table should be left aligned with respect to the anchor outside - the table should be outside of the anchor right - the table should be right aligned with respect to the anchor
-Optional ReadonlyrelativeSpecifies a relative vertical position for the table, relative to the verticalAnchor attribute. +
Optional ReadonlyrelativeVerticalPosition?: typeof RelativeVerticalPosition[keyof typeof RelativeVerticalPosition]Specifies a relative vertical position for the table, relative to the verticalAnchor attribute. This will supersede the absoluteVerticalPosition attribute. Possible values are: center - the table should be vertically centered with respect to the anchor inside - the table should be vertically aligned to the edge of the anchor and inside the anchor @@ -34,14 +34,14 @@ bottom - the table should be vertically aligned to the bottom edge of the anchor outside - the table should be vertically aligned to the edge of the anchor and outside the anchor inline - the table should be vertically aligned in line with the surrounding text (so as to not allow any text wrapping around it) top - the table should be vertically aligned to the top edge of the anchor
-Optional ReadonlyrightSpecifies the minimum distance to be maintained between the table and the edge of text in the paragraph +
Optional ReadonlyrightFromText?: number | PositiveUniversalMeasureSpecifies the minimum distance to be maintained between the table and the edge of text in the paragraph to the right of the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
-Optional ReadonlytopSpecifies the minimum distance to be maintained between the table and the bottom edge of text in the paragraph +
Optional ReadonlytopFromText?: number | PositiveUniversalMeasureSpecifies the minimum distance to be maintained between the table and the bottom edge of text in the paragraph above the table. The value is in twentieths of a point. If omitted, the value is assumed to be zero.
-Optional ReadonlyverticalSpecifies the vertical anchor or the base object from which the vertical positioning +
Optional ReadonlyverticalAnchor?: typeof TableAnchorType[keyof typeof TableAnchorType]Specifies the vertical anchor or the base object from which the vertical positioning in the absoluteVerticalPosition attribute should be determined. Possible values are: margin - relative to the horizontal edge of the text margin before any text runs (top edge for top-to-bottom paragraphs) page - relative to the horizontal edge of the page before any text runs (top edge for top-to-bottom paragraphs) text - relative to the horizontal edge of the text margin for the column in which the anchor paragraph is located If omitted, the value is assumed to be page.
-Options according to this docs: +
Options according to this docs: https://www.ecma-international.org/publications/standards/Ecma-376.htm Part 1 - Page 1251
Short Guide: http://officeopenxml.com/WPtableOfContents.php
-Optional Readonlycaption\a option - Includes captioned items, but omits caption labels and numbers. +
Optional ReadonlycaptionLabel?: string\a option - Includes captioned items, but omits caption labels and numbers. The identifier designated by text in this switch's field-argument corresponds to the caption label. Use captionLabelIncludingNumbers (\c) to build a table of captions with labels and numbers.
-Optional Readonlycaption\c option - Includes figures, tables, charts, and other items that are numbered +
Optional ReadonlycaptionLabelIncludingNumbers?: string\c option - Includes figures, tables, charts, and other items that are numbered by a SEQ field (§17.16.5.56). The sequence identifier designated by text in this switch's field-argument, which corresponds to the caption label, shall match the identifier in the corresponding SEQ field.
-Optional Readonlyentries\b option - Includes entries only from the portion of the document marked by +
Optional ReadonlyentriesFromBookmark?: string\b option - Includes entries only from the portion of the document marked by the bookmark named by text in this switch's field-argument.
-Optional Readonlyentry\p option - Text in this switch's field-argument specifies a sequence of characters +
Optional ReadonlyentryAndPageNumberSeparator?: string\p option - Text in this switch's field-argument specifies a sequence of characters that separate an entry and its page number. The default is a tab with leader dots.
-Optional Readonlyheading\o option - Uses paragraphs formatted with all or the specified range of builtin +
Optional ReadonlyheadingStyleRange?: string\o option - Uses paragraphs formatted with all or the specified range of builtin heading styles. Headings in a style range are specified by text in this switch's field-argument using the notation specified as for \l, where each integer corresponds to the style with a style ID of HeadingX (e.g. 1 corresponds to Heading1). If no heading range is specified, all heading levels used in the document are listed.
-Optional Readonlyhide\z Hides tab leader and page numbers in web page view (§17.18.102).
-Optional Readonlyhyperlink?: boolean\h option - Makes the table of contents entries hyperlinks.
-Optional Readonlypage\n option - Without field-argument, omits page numbers from the table of contents. +
Optional ReadonlyhideTabAndPageNumbersInWebView?: boolean\z Hides tab leader and page numbers in web page view (§17.18.102).
+Optional Readonlyhyperlink?: boolean\h option - Makes the table of contents entries hyperlinks.
+Optional ReadonlypageNumbersEntryLevelsRange?: string\n option - Without field-argument, omits page numbers from the table of contents. Page numbers are omitted from all levels unless a range of entry levels is specified by text in this switch's field-argument. A range is specified as for \l.
-Optional Readonlypreserve\x Preserves newline characters within table entries.
-Optional Readonlypreserve\w Preserves tab entries within table entries.
-Optional Readonlyseq\s option - For entries numbered with a SEQ field (§17.16.5.56), adds a prefix to the page number. +
Optional ReadonlypreserveNewLineInEntries?: boolean\x Preserves newline characters within table entries.
+Optional ReadonlypreserveTabInEntries?: boolean\w Preserves tab entries within table entries.
+Optional ReadonlyseqFieldIdentifierForPrefix?: string\s option - For entries numbered with a SEQ field (§17.16.5.56), adds a prefix to the page number. The prefix depends on the type of entry. text in this switch's field-argument shall match the identifier in the SEQ field.
-Optional Readonlysequence\d option - When used with \s, the text in this switch's field-argument defines +
Optional ReadonlysequenceAndPageNumbersSeparator?: string\d option - When used with \s, the text in this switch's field-argument defines the separator between sequence and page numbers. The default separator is a hyphen (-).
-Optional Readonlystyles\t field-argument Uses paragraphs formatted with styles other than the built-in heading styles. +
Optional ReadonlystylesWithLevels?: readonly StyleLevel[]\t field-argument Uses paragraphs formatted with styles other than the built-in heading styles. Text in this switch's field-argument specifies those styles as a set of comma-separated doublets, with each doublet being a comma-separated set of style name and table of content level. \t can be combined with \o.
-Optional Readonlytc\f option - Includes only those TC fields whose identifier exactly matches the +
Optional ReadonlytcFieldIdentifier?: string\f option - Includes only those TC fields whose identifier exactly matches the text in this switch's field-argument (which is typically a letter).
-Optional Readonlytc\l option - Includes TC fields that assign entries to one of the levels specified +
Optional ReadonlytcFieldLevelRange?: string\l option - Includes TC fields that assign entries to one of the levels specified by text in this switch's field-argument as a range having the form startLevel-endLevel, where startLevel and endLevel are integers, and startLevel has a value equal-to or less-than endLevel. TC fields that assign entries to lower levels are skipped.
-Optional Readonlyuse\u Uses the applied paragraph outline level.
-Optional ReadonlyuseAppliedParagraphOutlineLevel?: boolean\u Uses the applied paragraph outline level.
+ConstReadonlyBOTH: "both"Justified
-ReadonlyCENTER: "center"Align Center
-ReadonlyDISTRIBUTE: "distribute"Distribute All Characters Equally
-ReadonlyEND: "end"End
-ReadonlyHIGH_Widest Kashida Length
-ReadonlyJUSTIFIED: "both"Justified
-ReadonlyLEFT: "left"Align Left
-ReadonlyLOW_Low Kashida Length
-ReadonlyMEDIUM_Medium Kashida Length
-ReadonlyNUM_Align to List Tab
-ReadonlyRIGHT: "right"Align Right
-ReadonlySTART: "start"Align Start
-ReadonlyTHAI_Thai Language Justification
-ConstReadonlyBOTH: "both"Justified
+ReadonlyCENTER: "center"Align Center
+ReadonlyDISTRIBUTE: "distribute"Distribute All Characters Equally
+ReadonlyEND: "end"End
+ReadonlyHIGH_KASHIDA: "highKashida"Widest Kashida Length
+ReadonlyJUSTIFIED: "both"Justified
+ReadonlyLEFT: "left"Align Left
+ReadonlyLOW_KASHIDA: "lowKashida"Low Kashida Length
+ReadonlyMEDIUM_KASHIDA: "mediumKashida"Medium Kashida Length
+ReadonlyNUM_TAB: "numTab"Align to List Tab
+ReadonlyRIGHT: "right"Align Right
+ReadonlySTART: "start"Align Start
+ReadonlyTHAI_DISTRIBUTE: "thaiDistribute"Thai Language Justification
+ConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstReadonlyATLEAST: "atLeast"At least the value specified
-ReadonlyAUTO: "auto"Height is determined based on the content, so value is ignored.
-ReadonlyEXACT: "exact"Exactly the value specified
-ConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstUse blanks to prettify
-ConstUse blanks to prettify
+ConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstConstVertical merge types.
-ReadonlyCONTINUE: "continue"Cell that is merged with upper one.
-ReadonlyRESTART: "restart"Cell that is starting the vertical merge.
-ConstConstConstConstConstReadonlyAUTO: "auto"Auto.
-ReadonlyDXA: "dxa"Value is in twentieths of a point
-ReadonlyNIL: "nil"No (empty) value.
-ReadonlyPERCENTAGE: "pct"Value is in percentage.
-ConstConstConstConst
Deprecated
Do not use this method. It is only used internally by the library. It will be removed in a future version.
-