Generate & Manage Word DOCX via JavaScript Library

Open Source JavaScript Library to create, modify & convert Microsoft Word DOCX Documents. Add paragraph, headers & footers, Tables, bullet and numbers inside Word files.

Docx is an open source JavaScript API that provides the capability to generate and manage Word DOCX files inside their own JavaScript application with ease. The library can smoothly work for Node as well as on the Browser. The library is stable and easy to use. With just a couple of lines of code, developers can create and manipulate word documents without any external dependencies.

The Docx API supports several important features related to working with Word documents such as creating Word documents, modifying DOCX files, add a paragraph to a word file, add and manage headers & footers, insert and edit tables, bullet and numbering support, Table of content creation, set document margins, set page size, text alignment, Manage fonts and font sizes, document sections creation and many more.

Previous Next

Getting Started with Docx

The most recent release of officegen-DOCX can be installed directly from the online Officegen-DOCX repository by applying the following command.

Install Officegen-DOCX via npm

npm install --save docx 

Word Docx File Creation via JavaScript API

The open source DOCX API enables software developers to generate new Word documents in DOCX file formats with just a couple of lines of JavaScript code. Once the document is created you can easily modify it and add all your content such as Paragraphs, images, tables, etc. to it. You can also access and add word document properties, such as creator, description, title, subject, keywords, lastModifiedBy and revision.

Manage Section of Word Docx File

Sections are subdivisions of a word document that contains its own page formatting. A section can be a collection of paragraphs that have a specific set of properties such as page size, page numbers, page orientation, headers, borders, and margins. These properties are used to describe the pages on which the text will appear. The DOCX library completely support sections creation and all the relevant properties related to a section.

Manage Tables inside a Word File

Tables are one of the most common formatting elements that we are using in Microsoft Word. Tables help users to organize their content in different ways. The open source DOCX library gives software developers the capability to use tables inside their own JavaScript applications. The library supports adding a row to tables, repeat table row, add cells to table, set the width of a cell, add text to a cell, adding the nested table, merging cells together, add columns, add a border to a table, merge columns, and many more.

Manage Headers/Footers in Word DOCX

The open source DOCX library has included complete support for adding and managing custom headers and footers inside Word DOCX files. The library allows developers to insert tables, pictures, text, and charts into the headers and footers section with ease. The library also allows us to add multiple headers and footers by creating more sections. You easily set new headers and footers as per Section.