Readonly
val: Optional
Readonly
bottom?: stringOptional
Readonly
color?: stringOptional
Readonly
fill?: stringOptional
Readonly
footer?: stringOptional
Readonly
gutter?: stringOptional
Readonly
h?: stringOptional
Readonly
header?: stringOptional
Readonly
left?: stringOptional
Readonly
lineOptional
Readonly
pos?: string | numberOptional
Readonly
right?: stringOptional
Readonly
rsidR?: stringOptional
Readonly
rsidRPr?: stringOptional
Readonly
rsidOptional
Readonly
space?: stringOptional
Readonly
sz?: stringOptional
Readonly
top?: stringOptional
Readonly
type?: stringOptional
Readonly
val?: string | number | booleanOptional
Readonly
w?: stringAbstract
Abstract
Abstract
Abstract
prepAbstract
Abstract
prepAdds 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
-Readonly
children: readonly ParagraphChild[]Readonly
id: stringOptional
Readonly
attributes?: AttributePayload<T>Optional
Readonly
children?: readonly XmlComponent[]Readonly
name: stringOptional
options: ICheckboxSymbolOptionsOptional
options: ICheckboxSymbolOptionsOptional
font: stringOptional
font: stringOptional
options: ICheckboxSymbolOptionsOptional
options: ICheckboxSymbolOptionsOptional
anchor: stringOptional
anchor: stringReadonly
instanceReadonly
numReadonly
referenceReadonly
instanceReadonly
numReadonly
referenceOptional
Readonly
color?: stringOptional
Readonly
themeOptional
Readonly
themeOptional
Readonly
themeOptional
charSpace: numberOptional
type: Optional
charSpace: numberOptional
type: "default" | "lines" | "linesAndChars" | "snapToChars"Readonly
children: readonly ParagraphChild[]Readonly
link: stringReadonly
id: numberOptional
initContent: XmlComponentOptional
initContent: 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.
+Optional
initContent: XmlComponentOptional
initContent: XmlComponentAbstract
Abstract
Used 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: anyStatic
fromConverts the xml string to a XmlComponent tree.
+fromConverts the xml string to a XmlComponent tree.
+Optional
_attr: anyStatic
fromConverts the xml string to a XmlComponent tree.
xml content of the imported component
-Abstract
Optional
initComponent: InitializableXmlComponentAbstract
Optional
initComponent: InitializableXmlComponentReadonly
anchor: stringReadonly
children: readonly ParagraphChild[]Optional
start: numberOptional
start: numberReadonly
children: readonly MathComponent[]Readonly
children: readonly MathComponent[]Optional
children: readonly MathComponent[]Optional
children: readonly MathComponent[]Optional
value: stringOptional
value: stringOptional
limitLocationVal: stringOptional
limitLocationVal: stringReadonly
children: readonly MathComponent[]Readonly
children: readonly MathComponent[]Static
toOptional
prettify: Static
toOptional
prettify: Static
toOptional
prettify: Static
toOptional
prettify: Static
toOptional
prettify: Optional
options: IPageBordersOptionsOptional
options: 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.
+Optional
options: IParagraphPropertiesOptionsOptional
options: IParagraphPropertiesOptionsOptional
options: IParagraphStylePropertiesOptionsOptional
options: IParagraphStylePropertiesOptionsOptional
hint: stringOptional
hint: stringOptional
options: IRunPropertiesOptionsOptional
options: IRunPropertiesOptionsOptional
options: IRunStylePropertiesOptionsOptional
options: IRunStylePropertiesOptionsReadonly
val: Optional
cachedValue: stringOptional
cachedValue: stringText Direction within a table cell
-Text Direction within a table cell
+Optional
Readonly
leader?: Readonly
pos: string | numberReadonly
val: Static
Readonly
NONEStatic
Readonly
NONEOptional
properties: ITableOfContentsOptionsOptional
properties: ITableOfContentsOptionsReadonly
rule: "auto" | "atLeast" | "exact"Readonly
value: string | numberOptional
color: stringOptional
color: stringOptional
Readonly
verticalVertical merge element. Should be used in a table cell.
-Vertical merge element. Should be used in a table cell.
+Abstract
Abstract
Abstract
Abstract
Converts 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
Readonly
color?: stringBorder color, in hex (eg 'FF00AA')
-Optional
Readonly
size?: numberSize of the border in 1/8 pt
-Optional
Readonly
space?: numberSpacing offset. Values are specified in pt
-Readonly
style: typeof BorderStyle[keyof typeof BorderStyle]Optional
Readonly
color?: stringBorder color, in hex (eg 'FF00AA')
+Optional
Readonly
size?: numberSize of the border in 1/8 pt
+Optional
Readonly
space?: numberSpacing offset. Values are specified in pt
+Readonly
style: typeof BorderStyle[keyof typeof BorderStyle]Optional
Readonly
alignment?: typeof AlignmentType[keyof typeof AlignmentType]Optional
Readonly
contextualOptional
Readonly
indent?: IIndentAttributesPropertiesOptional
Readonly
keepSpecifies that all lines of the paragraph are to be kept on a single page when possible.
-Optional
Readonly
keepSpecifies 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
Readonly
leftOptional
Readonly
outlineOptional
Readonly
rightOptional
Readonly
spacing?: ISpacingPropertiesOptional
Readonly
thematicOptional
Readonly
alignment?: typeof AlignmentType[keyof typeof AlignmentType]Optional
Readonly
contextualSpacing?: booleanOptional
Readonly
indent?: IIndentAttributesPropertiesOptional
Readonly
keepLines?: booleanSpecifies that all lines of the paragraph are to be kept on a single page when possible.
+Optional
Readonly
keepNext?: 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
Readonly
leftTabStop?: numberOptional
Readonly
outlineLevel?: numberOptional
Readonly
rightTabStop?: numberOptional
Readonly
spacing?: ISpacingPropertiesOptional
Readonly
thematicBreak?: booleanOptional
Readonly
hyperlink?: boolean\h option - Creates a hyperlink to the bookmarked paragraph.
-Optional
Readonly
use\p option - Causes the field to display its position relative to the source +
Optional
Readonly
hyperlink?: boolean\h option - Creates a hyperlink to the bookmarked paragraph.
+Optional
Readonly
useRelativePosition?: 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
Readonly
autoThis 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
Readonly
autoSpaceEastAsianText?: 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
Readonly
bidirectional?: booleanOptional
Readonly
border?: IBordersOptionsOptional
Readonly
bullet?: { Readonly
level: numberOptional
Readonly
frame?: IFrameOptionsOptional
Readonly
heading?: typeof HeadingLevel[keyof typeof HeadingLevel]Optional
Readonly
overflowOptional
Readonly
pageOptional
Readonly
run?: IRunOptionsReference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.1.29.
-Optional
Readonly
scale?: numberOptional
Readonly
shading?: IShadingAttributesPropertiesOptional
Readonly
style?: stringOptional
Readonly
suppressOptional
Readonly
tabOptional
Readonly
widowOptional
Readonly
wordOptional
Readonly
bidirectional?: booleanOptional
Readonly
border?: IBordersOptionsOptional
Readonly
bullet?: { level: number }Optional
Readonly
frame?: IFrameOptionsOptional
Readonly
heading?: typeof HeadingLevel[keyof typeof HeadingLevel]Optional
Readonly
overflowPunctuation?: booleanOptional
Readonly
pageBreakBefore?: booleanOptional
Readonly
run?: IRunOptionsReference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.3.1.29.
+Optional
Readonly
scale?: numberOptional
Readonly
shading?: IShadingAttributesPropertiesOptional
Readonly
style?: stringOptional
Readonly
suppressLineNumbers?: booleanOptional
Readonly
tabStops?: readonly TabStopDefinition[]Optional
Readonly
widowControl?: booleanOptional
Readonly
wordWrap?: booleanOptional
Readonly
absoluteSpecifies an absolute horizontal position for the table, relative to the horizontalAnchor. +
Optional
Readonly
absoluteHorizontalPosition?: 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
Readonly
absoluteSpecifies an absolute vertical position for the table, relative to the verticalAnchor anchor. +
Optional
Readonly
absoluteVerticalPosition?: 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
Readonly
bottomSpecifies the minimum distance to be maintained between the table and the top of text in the paragraph +
Optional
Readonly
bottomFromText?: 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
Readonly
horizontalSpecifies the horizontal anchor or the base object from which the horizontal positioning in the +
Optional
Readonly
horizontalAnchor?: 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
Readonly
leftSpecifies the minimum distance to be maintained between the table and the edge of text in the paragraph +
Optional
Readonly
leftFromText?: 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
Readonly
overlap?: typeof OverlapType[keyof typeof OverlapType]Optional
Readonly
relativeSpecifies a relative horizontal position for the table, relative to the horizontalAnchor attribute. +
Optional
Readonly
overlap?: typeof OverlapType[keyof typeof OverlapType]Optional
Readonly
relativeHorizontalPosition?: 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
Readonly
relativeSpecifies a relative vertical position for the table, relative to the verticalAnchor attribute. +
Optional
Readonly
relativeVerticalPosition?: 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
Readonly
rightSpecifies the minimum distance to be maintained between the table and the edge of text in the paragraph +
Optional
Readonly
rightFromText?: 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
Readonly
topSpecifies the minimum distance to be maintained between the table and the bottom edge of text in the paragraph +
Optional
Readonly
topFromText?: 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
Readonly
verticalSpecifies the vertical anchor or the base object from which the vertical positioning +
Optional
Readonly
verticalAnchor?: 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
Readonly
caption\a option - Includes captioned items, but omits caption labels and numbers. +
Optional
Readonly
captionLabel?: 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
Readonly
caption\c option - Includes figures, tables, charts, and other items that are numbered +
Optional
Readonly
captionLabelIncludingNumbers?: 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
Readonly
entries\b option - Includes entries only from the portion of the document marked by +
Optional
Readonly
entriesFromBookmark?: 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
Readonly
entry\p option - Text in this switch's field-argument specifies a sequence of characters +
Optional
Readonly
entryAndPageNumberSeparator?: 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
Readonly
heading\o option - Uses paragraphs formatted with all or the specified range of builtin +
Optional
Readonly
headingStyleRange?: 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
Readonly
hide\z Hides tab leader and page numbers in web page view (§17.18.102).
-Optional
Readonly
hyperlink?: boolean\h option - Makes the table of contents entries hyperlinks.
-Optional
Readonly
page\n option - Without field-argument, omits page numbers from the table of contents. +
Optional
Readonly
hideTabAndPageNumbersInWebView?: boolean\z Hides tab leader and page numbers in web page view (§17.18.102).
+Optional
Readonly
hyperlink?: boolean\h option - Makes the table of contents entries hyperlinks.
+Optional
Readonly
pageNumbersEntryLevelsRange?: 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
Readonly
preserve\x Preserves newline characters within table entries.
-Optional
Readonly
preserve\w Preserves tab entries within table entries.
-Optional
Readonly
seq\s option - For entries numbered with a SEQ field (§17.16.5.56), adds a prefix to the page number. +
Optional
Readonly
preserveNewLineInEntries?: boolean\x Preserves newline characters within table entries.
+Optional
Readonly
preserveTabInEntries?: boolean\w Preserves tab entries within table entries.
+Optional
Readonly
seqFieldIdentifierForPrefix?: 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
Readonly
sequence\d option - When used with \s, the text in this switch's field-argument defines +
Optional
Readonly
sequenceAndPageNumbersSeparator?: 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
Readonly
styles\t field-argument Uses paragraphs formatted with styles other than the built-in heading styles. +
Optional
Readonly
stylesWithLevels?: 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
Readonly
tc\f option - Includes only those TC fields whose identifier exactly matches the +
Optional
Readonly
tcFieldIdentifier?: 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
Readonly
tc\l option - Includes TC fields that assign entries to one of the levels specified +
Optional
Readonly
tcFieldLevelRange?: 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
Readonly
use\u Uses the applied paragraph outline level.
-Optional
Readonly
useAppliedParagraphOutlineLevel?: boolean\u Uses the applied paragraph outline level.
+Const
Readonly
BOTH: "both"Justified
-Readonly
CENTER: "center"Align Center
-Readonly
DISTRIBUTE: "distribute"Distribute All Characters Equally
-Readonly
END: "end"End
-Readonly
HIGH_Widest Kashida Length
-Readonly
JUSTIFIED: "both"Justified
-Readonly
LEFT: "left"Align Left
-Readonly
LOW_Low Kashida Length
-Readonly
MEDIUM_Medium Kashida Length
-Readonly
NUM_Align to List Tab
-Readonly
RIGHT: "right"Align Right
-Readonly
START: "start"Align Start
-Readonly
THAI_Thai Language Justification
-Const
Readonly
BOTH: "both"Justified
+Readonly
CENTER: "center"Align Center
+Readonly
DISTRIBUTE: "distribute"Distribute All Characters Equally
+Readonly
END: "end"End
+Readonly
HIGH_KASHIDA: "highKashida"Widest Kashida Length
+Readonly
JUSTIFIED: "both"Justified
+Readonly
LEFT: "left"Align Left
+Readonly
LOW_KASHIDA: "lowKashida"Low Kashida Length
+Readonly
MEDIUM_KASHIDA: "mediumKashida"Medium Kashida Length
+Readonly
NUM_TAB: "numTab"Align to List Tab
+Readonly
RIGHT: "right"Align Right
+Readonly
START: "start"Align Start
+Readonly
THAI_DISTRIBUTE: "thaiDistribute"Thai Language Justification
+Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Readonly
ATLEAST: "atLeast"At least the value specified
-Readonly
AUTO: "auto"Height is determined based on the content, so value is ignored.
-Readonly
EXACT: "exact"Exactly the value specified
-Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Use blanks to prettify
-Const
Use blanks to prettify
+Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Vertical merge types.
-Readonly
CONTINUE: "continue"Cell that is merged with upper one.
-Readonly
RESTART: "restart"Cell that is starting the vertical merge.
-Const
Const
Const
Const
Const
Readonly
AUTO: "auto"Auto.
-Readonly
DXA: "dxa"Value is in twentieths of a point
-Readonly
NIL: "nil"No (empty) value.
-Readonly
PERCENTAGE: "pct"Value is in percentage.
-Const
Const
Const
Const
Deprecated
Do not use this method. It is only used internally by the library. It will be removed in a future version.
-