Open Source Ruby Library for Word Document Processing

Free Ruby API that enables software developers to generate and Edit Microsoft Word files, manage headers & footers, insert and edit tables, and much more.

Docx is an open source JavaScript library that provides the capability to generate and manage Word DOCX files from within JavaScript applications with ease. 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 paragraphs 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 section creation and more.

Previous Next

Getting Started with Docx

The recommended way to install is using GEM.

Install Docx via GEM

 gem install docx

Write to Existing DOCX via Ruby

The Ruby Docx library enables software developers to open existing DOCX files and update the content inside the file inside your own Ruby applications. To open the file you need to provide the correct path of the existing DOCX file. Once you can have access to the documents you can easily add a single line of text or paragraphs, substitute text, remove unwanted content, modify the existing text, and so on. Once everything is properly completed you can save the document to the specified path.

Reading DOCX via Ruby Library

The open source Ruby Docx library allows accessing and reading Word DOCX files using just a couple of lines of Ruby code. Developers can create the document object from an existing DOCX file and can retrieve and display the content of the file.

Reading Tables from Word DOCX Files

Ruby DOCX library gives software developers the capability to access and read tables inside a DOCX file using Ruby commands. It allows to access rows, columns and cells of tables as well as provides support to iterate through tables using row-based or column-based iteration.