2021-11-08 16:17:40 +00:00
<!DOCTYPE html> < html class = "default" > < head > < meta charSet = "utf-8" / > < meta http-equiv = "x-ua-compatible" content = "IE=edge" / > < title > docx< / title > < meta name = "description" content = "Documentation for docx" / > < meta name = "viewport" content = "width=device-width, initial-scale=1" / > < link rel = "stylesheet" href = "assets/style.css" / > < link rel = "stylesheet" href = "assets/highlight.css" / > < script async src = "assets/search.js" id = "search-script" > < / script > < / head > < body > < script > document . body . classList . add ( localStorage . getItem ( "tsd-theme" ) || "os" ) < / script > < header > < div class = "tsd-page-toolbar" > < div class = "container" > < div class = "table-wrap" > < div class = "table-cell" id = "tsd-search" data-base = "." > < div class = "field" > < label for = "tsd-search-field" class = "tsd-widget search no-caption" > Search< / label > < input type = "text" id = "tsd-search-field" / > < / div > < ul class = "results" > < li class = "state loading" > Preparing search index...< / li > < li class = "state failure" > The search index is not available< / li > < / ul > < a href = "index.html" class = "title" > docx< / a > < / div > < div class = "table-cell" id = "tsd-widgets" > < div id = "tsd-filter" > < a href = "#" class = "tsd-widget options no-caption" data-toggle = "options" > Options< / a > < div class = "tsd-filter-group" > < div class = "tsd-select" id = "tsd-filter-visibility" > < span class = "tsd-select-label" > All< / span > < ul class = "tsd-select-list" > < li data-value = "public" > Public< / li > < li data-value = "protected" > Public/Protected< / li > < li data-value = "private" class = "selected" > All< / li > < / ul > < / div > < input type = "checkbox" id = "tsd-filter-inherited" checked / > < label class = "tsd-widget" for = "tsd-filter-inherited" > Inherited< / label > < input type = "checkbox" id = "tsd-filter-externals" checked / > < label class = "tsd-widget" for = "tsd-filter-externals" > Externals< / label > < / div > < / div > < a href = "#" class = "tsd-widget menu no-caption" data-toggle = "menu" > Menu< / a > < / div > < / div > < / div > < / div > < div class = "tsd-page-title" > < div class = "container" > < h1 > docx< / h1 > < / div > < / div > < / header > < div class = "container container-main" > < div class = "row" > < div class = "col-8 col-content" > < div class = "tsd-panel tsd-typography" > < p align = "center" >
2021-09-30 02:17:43 +00:00
< img alt = "clippy the assistant" src = "https://i.imgur.com/37uBGhO.gif" >
< / p >
< p align = "center" >
Easily generate .docx files with JS/TS. Works for Node and on the Browser.
< / p >
< hr >
< p > < a href = "https://npmjs.org/package/docx" > < img src = "https://badge.fury.io/js/docx.svg" alt = "NPM version" > < / a >
< a href = "https://npmjs.org/package/docx" > < img src = "https://img.shields.io/npm/dm/docx.svg" alt = "Downloads per month" > < / a >
< a href = "https://github.com/dolanmiu/docx/actions" > < img src = "https://github.com/dolanmiu/docx/workflows/Default/badge.svg" alt = "GitHub Action Workflow Status" > < / a >
< a href = "https://david-dm.org/dolanmiu/docx" > < img src = "https://david-dm.org/dolanmiu/docx.svg?theme=shields.io" alt = "Dependency Status" > < / a >
< a href = "https://snyk.io/test/github/dolanmiu/docx" > < img src = "https://snyk.io/test/github/dolanmiu/docx/badge.svg" alt = "Known Vulnerabilities" > < / a >
< a href = "https://gitter.im/docx-lib/Lobby" > < img src = "https://badges.gitter.im/dolanmiu/docx.svg" alt = "Chat on Gitter" > < / a >
< a href = "http://makeapullrequest.com" > < img src = "https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt = "PRs Welcome" > < / a >
< a href = "https://codecov.io/gh/dolanmiu/docx" > < img src = "https://codecov.io/gh/dolanmiu/docx/branch/master/graph/badge.svg" alt = "codecov" > < / a > < / p >
< p align = "center" >
< img src = "https://i.imgur.com/QeL1HuU.png" alt = "drawing" / >
< / p >
< a href = "#demo" id = "demo" style = "color: inherit; text-decoration: none;" >
< h1 > Demo< / h1 >
< / a >
< a href = "#browser" id = "browser" style = "color: inherit; text-decoration: none;" >
< h2 > Browser< / h2 >
< / a >
< p > Here are examples of < code > docx< / code > being used with basic < code > HTML/JS< / code > in a browser environment:< / p >
< ul >
< li > < a href = "https://codepen.io/dolanmiu/pen/RwNeObg" > https://codepen.io/dolanmiu/pen/RwNeObg< / a > < / li >
< li > < a href = "https://jsfiddle.net/dolanmiu/onadx1gu/" > https://jsfiddle.net/dolanmiu/onadx1gu/< / a > < / li >
< / ul >
< p > Here is an example of < code > docx< / code > working in < code > Angular< / code > :< / p >
< ul >
< li > < a href = "https://stackblitz.com/edit/angular-docx" > https://stackblitz.com/edit/angular-docx< / a > < / li >
< / ul >
< p > Here is an example of < code > docx< / code > working in < code > React< / code > :< / p >
< ul >
< li > < a href = "https://stackblitz.com/edit/react-docx" > https://stackblitz.com/edit/react-docx< / a > < / li >
< li > < a href = "https://stackblitz.com/edit/react-docx-images" > https://stackblitz.com/edit/react-docx-images< / a > (adding images to Word Document)< / li >
< / ul >
< p > Here is an example of < code > docx< / code > working in < code > Vue.js< / code > :< / p >
< ul >
< li > < a href = "https://stackblitz.com/edit/vuejs-docx" > https://stackblitz.com/edit/vuejs-docx< / a > < / li >
< / ul >
< a href = "#node" id = "node" style = "color: inherit; text-decoration: none;" >
< h2 > Node< / h2 >
< / a >
< p > Press < code > endpoint< / code > on the < code > RunKit< / code > website:< / p >
< p > < img src = "https://user-images.githubusercontent.com/2917613/38582539-f84311b6-3d07-11e8-90db-5885ae02c3c4.png" alt = "RunKit Instructions" > < / p >
< ul >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo1" > https://runkit.com/dolanmiu/docx-demo1< / a > - Simple paragraph and text< / li >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo2" > https://runkit.com/dolanmiu/docx-demo2< / a > - Advanced Paragraphs and text< / li >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo3" > https://runkit.com/dolanmiu/docx-demo3< / a > - Bullet points< / li >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo4" > https://runkit.com/dolanmiu/docx-demo4< / a > - Simple table< / li >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo5" > https://runkit.com/dolanmiu/docx-demo5< / a > - Images< / li >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo6" > https://runkit.com/dolanmiu/docx-demo6< / a > - Margins< / li >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo7" > https://runkit.com/dolanmiu/docx-demo7< / a > - Landscape< / li >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo8" > https://runkit.com/dolanmiu/docx-demo8< / a > - Header and Footer< / li >
< li > < a href = "https://runkit.com/dolanmiu/docx-demo10" > https://runkit.com/dolanmiu/docx-demo10< / a > - < strong > My CV generated with docx< / strong > < / li >
< / ul >
< p > More < a href = "https://github.com/dolanmiu/docx/tree/master/demo" > here< / a > < / p >
< a href = "#how-to-use-amp-documentation" id = "how-to-use-amp-documentation" style = "color: inherit; text-decoration: none;" >
< h1 > How to use & Documentation< / h1 >
< / a >
< p > Please refer to the < a href = "https://docx.js.org/" > documentation at https://docx.js.org/< / a > for details on how to use this library, examples and much more!< / p >
< a href = "#examples" id = "examples" style = "color: inherit; text-decoration: none;" >
< h1 > Examples< / h1 >
< / a >
< p > Check the < a href = "https://github.com/dolanmiu/docx/tree/master/demo" > demo folder< / a > for examples.< / p >
< a href = "#contributing" id = "contributing" style = "color: inherit; text-decoration: none;" >
< h1 > Contributing< / h1 >
< / a >
< p > Read the contribution guidelines < a href = "https://docx.js.org/#/contribution-guidelines" > here< / a > .< / p >
< a href = "#used-by" id = "used-by" style = "color: inherit; text-decoration: none;" >
< h1 > Used by< / h1 >
< / a >
< p > < a href = "https://hfour.com/" > < img src = "https://i.imgur.com/zy5qWmI.png" alt = "drawing" height = "50" / > < / a >
< a href = "https://fuzzproductions.com/" > < img src = "https://i.imgur.com/OYP5tgS.png" alt = "drawing" height = "50" / > < / a >
< a href = "https://www.mettzer.com/" > < img src = "https://i.imgur.com/zUDMfZ3.png" alt = "drawing" height = "50" / > < / a >
< a href = "https://www.wisedoc.net/" > < img src = "https://i.imgur.com/wtNB1uq.png" alt = "drawing" height = "50" / > < / a >
< a href = "https://www.dabblewriter.com/" > < img src = "https://i.imgur.com/suiH2zc.png" alt = "drawing" height = "50" / > < / a >
< a href = "https://turbopatent.com/" > < img src = "https://i.imgur.com/1LjuK2M.png" alt = "drawing" height = "50" / > < / a >
< a href = "http://www.madisoncres.com/" > < img src = "https://i.imgur.com/dHMg0wF.gif" alt = "drawing" height = "50" / > < / a >
< a href = "https://www.beekast.com/" > < img src = "https://i.imgur.com/QEZXU5b.png" alt = "drawing" height = "50" / > < / a >
< a href = "https://herraizsoto.com/" > < img src = "https://i.imgur.com/XVU6aoi.png" alt = "drawing" height = "50" / > < / a >
< a href = "http://www.ativer.com.br/" > < img src = "https://i.imgur.com/fn1xccG.png" alt = "drawing" height = "50" / > < / a >
< a href = "https://www.arity.co/" > < img src = "https://i.imgur.com/cmykN7c.png" alt = "drawing" / > < / a >
< a href = "https://www.circadianrisk.com/" > < img src = "https://i.imgur.com/PXo25um.png" alt = "drawing" height = "50" / > < / a > < / p >
< p > ...and many more!< / p >
< hr >
< p > < a href = "https://www.patreon.com/dolanmiu" > < img src = "https://user-images.githubusercontent.com/2917613/51251459-4e880480-1991-11e9-92bf-38b96675a9e2.png" alt = "patreon" > < / a >
< a href = "https://www.browserstack.com" > < img src = "https://user-images.githubusercontent.com/2917613/54233552-128e9d00-4505-11e9-88fb-025a4e04007c.png" alt = "browserstack" > < / a > < / p >
< p > Made with 💖< / p >
2021-11-26 15:10:38 +00:00
< / div > < / div > < div class = "col-4 col-menu menu-sticky-wrap menu-highlight" > < nav class = "tsd-navigation primary" > < ul > < li class = "current" > < a href = "modules.html" > Exports< / a > < / li > < / ul > < / nav > < nav class = "tsd-navigation secondary menu-sticky" > < ul > < li class = "tsd-kind-reference" > < a href = "modules.html#File" class = "tsd-kind-icon" > File< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/AlignmentType.html" class = "tsd-kind-icon" > Alignment< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/BorderStyle.html" class = "tsd-kind-icon" > Border< wbr / > Style< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/DropCapType.html" class = "tsd-kind-icon" > Drop< wbr / > Cap< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/EmphasisMarkType.html" class = "tsd-kind-icon" > Emphasis< wbr / > Mark< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/FrameAnchorType.html" class = "tsd-kind-icon" > Frame< wbr / > Anchor< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/FrameWrap.html" class = "tsd-kind-icon" > Frame< wbr / > Wrap< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/HeaderFooterReferenceType.html" class = "tsd-kind-icon" > Header< wbr / > Footer< wbr / > Reference< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/HeaderFooterType.html" class = "tsd-kind-icon" > Header< wbr / > Footer< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/HeadingLevel.html" class = "tsd-kind-icon" > Heading< wbr / > Level< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/HeightRule.html" class = "tsd-kind-icon" > Height< wbr / > Rule< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/HorizontalPositionAlign.html" class = "tsd-kind-icon" > Horizontal< wbr / > Position< wbr / > Align< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/HorizontalPositionRelativeFrom.html" class = "tsd-kind-icon" > Horizontal< wbr / > Position< wbr / > Relative< wbr / > From< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/HyperlinkType.html" class = "tsd-kind-icon" > Hyperlink< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/LeaderType.html" class = "tsd-kind-icon" > Leader< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/LevelFormat.html" class = "tsd-kind-icon" > Level< wbr / > Format< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/LevelSuffix.html" class = "tsd-kind-icon" > Level< wbr / > Suffix< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/LineNumberRestartFormat.html" class = "tsd-kind-icon" > Line< wbr / > Number< wbr / > Restart< wbr / > Format< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/LineRuleType.html" class = "tsd-kind-icon" > Line< wbr / > Rule< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/NumberFormat.html" class = "tsd-kind-icon" > Number< wbr / > Format< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/OverlapType.html" class = "tsd-kind-icon" > Overlap< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/PageBorderDisplay.html" class = "tsd-kind-icon" > Page< wbr / > Border< wbr / > Display< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/PageBorderOffsetFrom.html" class = "tsd-kind-icon" > Page< wbr / > Border< wbr / > Offset< wbr / > From< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/PageBorderZOrder.html" class = "tsd-kind-icon" > Page< wbr / > BorderZOrder< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/PageNumber.html" class = "tsd-kind-icon" > Page< wbr / > Number< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/PageNumberSeparator.html" class = "tsd-kind-icon" > Page< wbr / > Number< wbr / > Separator< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/PageOrientation.html" class = "tsd-kind-icon" > Page< wbr / > Orientation< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/PageTextDirectionType.html" class = "tsd-kind-icon" > Page< wbr / > Text< wbr / > Direction< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/RelativeHorizontalPosition.html" class = "tsd-kind-icon" > Relative< wbr / > Horizontal< wbr / > Position< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/RelativeVerticalPosition.html" class = "tsd-kind-icon" > Relative< wbr / > Vertical< wbr / > Position< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/SectionType.html" class = "tsd-kind-icon" > Section< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/ShadingType.html" class = "tsd-kind-icon" > Shading< wbr / > Type< / a > < / li > < li class = "tsd-kind-enum" > < a href = "enums/T