1. Products
  2.   Editor
  3.   .NET
  4.   DocX
 
  

Open Source .NET SDK for working with DOCX Files

Free & Powerful Open Source .NET API to create, edit and convert DOCX documents.

What is DOCX API for .NET?

DOCX is a powerful .NET API for working with the popular DOCX files that are created when you save your work from within Microsoft Word. It gives you easy to use API interface to load a DOCX file in your .NET application, read its contents, modify the images, insert tables, and conver to other formats such as PDF and HTML.

DOCX for .NET API - Key Features

Following are some of the main features of DocX API:

  • Document Creation and Modification: DocX lets you create DOCX files from scratch. You can also load and modify the contents of the file using the well-organized structure of this API.
  • Text Manipulation: You can insert and edit text, Format text (font, size, color, bold, italic, underline, etc.), and apply text alignment (left, right, center, justify).
  • Paragraph Management: Add and manage paragraphs, apply paragraph formatting (indentation, spacing, etc.), and Insert and format bullet points and numbered lists.
  • Table Management: Create and manipulate tables, add rows and columns dynamically, apply styling to tables and cells (borders, shading, etc.), and merge cells within tables.
  • Image Insertion and Management: Insert images into the document, resize and position images, and apply text wrapping around images.
  • Header and Footer: Create and edit headers and footers, insert page numbers, dates, and other dynamic fields, and apply different headers/footers for odd/even pages or first page.
  • Hyperlinks and Bookmarks: Add hyperlinks to external URLs or internal document bookmarks, create and navigate bookmarks within the document.
GitHub

GitHub Stats

Name:
Language:
Stars:
Forks:
License:
Repository was last updated at

Getting Started with DocX for .NET API

We can download the DocX library from GitHub or using pip install command:

Installation

Installing DocX is simple and can be done from nugget as shown below:

Installing DocX API for .NET


Install-Package DocX -Version 1.5.0

Code Examples for Docx API for .NET

DocX is a powerful API that provides rich features for working with Document features. You can find C# examples for creating Word document, update an exisitng DOCX file, Insert Header and Footer in the document and work with images in this section.

How to Create a blank DOCX file using DocX API for .NET?

You can create a blank DOCX document using the DocX API's DocX class. It can then be saved to disc as DOCX file in the Microsoft Word's 2007+ format as shown in below example:

Open an Existing DOCX File in .NET and Modify it

You can load an existing DOCX file using DocX API and modify its contents. Once you are done with your changes, you can save the document back to the disc similar to the "Save As" option available in Microsoft Word.

How to Add Headers and Footers to Word Document in .NET?

DocX API lets you add header and footer to a Word document from within your .NET application. You can add header to the Word file, modify its contents, add footer and update its contents as shown in code sample below.

Insert Image in a Word DOCX File

The DocX API enables software developers to programmatically manipulate images embedded in Word DOCX documents. Initially, ensure an image is present within a Word document. To modify the image, begin by opening the document, then apply desired changes such as adding custom text or other modifications to the image. Finally, save the document to preserve these changes.

Conclusion

DocX by Xceed is a comprehensive and versatile library for .NET developers looking to create, manipulate, and manage DOCX files effortlessly. With its rich set of features, including text and paragraph manipulation, table and image management, header and footer customization, hyperlink and bookmark insertion, and document protection, DocX simplifies complex document operations. The library's user-friendly API makes it accessible for both novice and experienced developers, enabling them to produce professional-quality Word documents with ease. Whether you need to generate dynamic reports, automate document creation, or integrate DOCX functionality into your applications, DocX by Xceed provides a powerful and reliable solution.

Similar Products