What is DocX?
DocX is a .NET library that allows developers to manipulate Word 2007/2010/2013 files, in an easy and intuitive manner. DocX is fast, lightweight and best of all it does not require Microsoft Word or Office to be installed.
NOTE: There is a new Master branch as of Oct. 3, 2017. Please read about the Classic branch if you were using this project before the change.
DocX is the free, open source version of Xceed Words for .NET. Originally written by Cathal Coffey, and maintained by Przemyslaw Klys, it is now maintained by Xceed.
Currently, the differences between DocX and Xceed Words for .NET, is that Xceed Words for .NET :
- can convert a Word document to PDF
- adds properties to wrap text around Pictures/Tables/Shapes
- adds Picture cropping
- adds Shapes (rectangles for now)
- adds TextBoxes or Shapes containing Text
- gets Shapes from Paragraphs
- gets Charts from Paragraphs and can modify their categories/values
- is at least two versions ahead of the DocX version
- has professional technical support included in the subscription
What else do I need?
What are the main features of DocX?
|Edition||DocX||Xceed Words for .NET|
|Create new Word documents||YES||YES|
|Modify Word documents||YES||YES|
|Create new PDF documents||YES|
|Convert Word to PDF||YES|
|Supports .DOCX from Word 2007 and up||YES||YES|
|Modify multiple documents in parallel for better performance||YES||YES|
|Apply a template to a Word document||YES||YES|
|Join documents, recreate portions from one to another||YES||YES|
|Supports document protection with or without password||YES||YES|
|Set document margins and page size||YES||YES|
|Set line spacing, indentation, text direction, text alignment||YES||YES|
|Wrap text around pictures||YES|
|Pictures with cropping||YES|
|Manage fonts and font sizes||YES||YES|
|Set text color, bold, underline, italic, strikethrough, highlighting||YES||YES|
|Set page numbering||YES||YES|
|Update document fields (ex: a table of contents) by calling only one method||YES|
|Wrap text around tables||YES|
|Wrap text around shapes||YES|
|Create shapes (rectangles for now)||YES|
|Create textboxes or shapes containing text||YES|
|Get shapes from paragraphs||YES|
|Get charts from paragraphs and modify their categories/values||YES|
|Available on .net standard 2.0+ for .net core 2.0+ applications||YES|
|2 or more release ahead||YES|
Supported Word document elements
- Add headers or footers which can be the same on all pages, or unique for the first page, or unique for odd/even pages. Can contain images, hyperlinks and more.
- Insert/Modify paragraphs.
- Insert/Modify numbered or bulleted lists.
- Insert/Modify images. Flip, rotate, copy, modify, resize.
- Insert/Modify tables. Insert/Remove rows, columns, change direction, column width, row height, borders, merge/delete cells.
- Insert/Modify formatted equations or formulas.
- Insert/Modify bookmarks.
- Insert/Modify hyperlinks.
- Insert/Modify horizontal lines.
- Insert/Modify charts (bar, line, pie, 3D chart). Set colors, titles, legend, etc.
- Find, remove or replace text. Supports case sensitivity and regular expressions.
- Insert/Modify core or custom properties, such as author, address, subject, title, etc.
- Insert a Table Of Contents. Set title, change formatting.
- Insert/Modify shapes (rectangles for now)
- Update document fields
Why would I use DocX?
DocX makes creating and manipulating documents a simple task. It does not use COM libraries nor does it require Microsoft Office to be installed.
The following blog post from Cathal Coffey compares the code used to create a HelloWorld document using:
- Office Interop libraries,
- OOXML SDK,
- Step by step guide to create an invoice for a company. http://cathalscorner.blogspot.com/2009/08/docx-v1007-released.html
- Replace text across many documents in Parallel. http://cathalscorner.blogspot.com/2010/12/replace-text-across-many-documents-in.html
- Programmatically manipulate an Image imbedded inside a document. http://cathalscorner.blogspot.com/2010/12/programmatically-manipulate-image.html
- Converting DocX into (.doc, .pdf, .html) http://cathalscorner.blogspot.com/2009/10/converting-docx-into-doc-pdf-html.html
Do you have an interesting or informative example that you would like to share? If you do, please email me.
- February 21, 2019, released DocX v1.3.0 with 12 bug fixes and improvements.
- January 28, 2019, released Xceed Words for .NET v1.6.0 with 71 bug fixes and improvements.
- June 27, 2018, released DocX v1.2.0 with 13 bug fixes and improvements.
- June 18, 2018, released Xceed Words for .NET v1.5.0 with 71 bug fixes and improvements.
- April 12, 2018, released Xceed Words for .NET v1.4.1 with 22 bug fixes and improvements.
- January 15, 2018, released Xceed Words for .NET v1.4.0 with 19 bug fixes and improvements.
- September 12, 2017, released Xceed Words for .NET v1.3.0 with 13 bug fixes and improvements.
- June 5, 2017, released Xceed Words for .NET v1.2.0 with 13 bug fixes and improvements.
- October 3, 2017, released DocX v1.1.0 with 6 bug fixes and improvements.
- March 1, 2017, released Xceed Words for .NET v1.1.0 with 6 bug fixes and improvements.