Open, create, edit, merge, split, compare and convert a Word document in Java. It's easy for Java developers to manipulate Microsoft Word documents. Simply integrate our Cloud API into your Java applications to get full-featured Word API to handle documents. It supports all popular file formats such as DOCX, DOC, RTF, HTML, ODT, XPS, EPUB, etc.
File handling is an important part of any application. Java has several methods for creating, reading, updating and deleting files. Java API offers methods which allow you to:
- Convert DOCX, DOC, PDF, JPG, etc.
- Perform the basic CRUD operations of creating, retrieving, updating and deleting documents.
- Perform various Word operations.
- Insert page numbers.
- Append, convert and split documents.
Note: Java APIs libraries are hosted on Aspose repository.
At a Glance
- .NET Graphics
- PNG, JPEG, BMP, GIF
- XPS, OpenXPS
- PDF, PDF/A-1a, PDF/A-1b
- PostScript (PS)
- XamlFixed, XamlFlow or XamlFlowPack
Supported File Formats
Aspose.Words Cloud supported file formats.
- Microsoft Word: DOC, DOCX, RTF, DOT, DOTX, DOTM, FlatOPC (XML)
- OpenOffice: ODT, OTT
- WordprocessingML: XML
- Web: HTML, MHTML, HtmlFixed
- Text: TXT
- Fixed Layout: PDF
- Fixed Layout: PDF/A, XPS, OpenXPS, PS
- Images: JPEG, PNG, BMP, SVG, TIFF, EMF
- Others: PCL
Aspose.Words Cloud supports all major platforms and programming languages.
Advanced Word Document Processing Features
Merge multiple Word documents
Split all or specific pages of a Word document
Convert Word documents to different formats
Manipulate document properties
Execute simple to complex mail merge
Execute mail merge template
Insert scaled images on merge fields
Insert a page number field into Word documents
Insert or edit watermark in Word documents
Find or replace text in Word documents
Password protect Word documents or update document protection
Load & convert PDF documents to Word formats including DOC & DOCX
Key features in Java
You can use API to perform different operations on Word documents such as inserting a table, adding paragraphs, extracting text, inserting an image, inserting a watermark image, getting hyperlinks and adding a header or a footer.
You can perform conversion operations for different file formats in Java such as:
- Convert PDF to Word.
- Convert Word to PDF.
- Convert Word to TXT.
- Convert Word to EPUB.
- Convert DOCX to image.
Work with Word Tables via Java
You can use a table to structure content, place text or images in one cell and align it accordingly. Furthermore, tables can be nested inside other tables up to any depth with Java API.
Working with tables includes many tasks such as:
- Getting a list of tables that are contained in a Word document.
- Inserting, updating, deleting and getting a table from a document.
- Adding a table to a document.
- Getting and updating table properties.
- Getting, adding and deleting a table.
- Getting, adding and deleting a table cell.
- Extracting data from a table.
Working with Word Math Objects
API allows you to get all Word Math objects that are defined in a document.
It includes many tasks such as getting and removing Objects from a Word document.
Working with Headers and Footers
API supports page headers and page footers.
This includes many tasks such as:
- Accessing the header for a section.
- Removing a header.
- Adding a header.
- Getting all headers and footers in a Word document.
Report Generation and Mail Merge
Our API report generation and mail merge provide you with several tasks such as:
- Using Word merge fields or Mustache.
- Preparing DOCX templates to populate or other supported file formats.
- Populating templates with data from JSON, XML.
- Inserting HTML and images during mail merge.
Working with Text in Word via Java
API allows you to find and replace text in DOCX and other documents in Java.
It has string searching and string matching algorithms to find all appearances of a character pattern, to find a place where one or many patterns are found within a larger string or text.
In other words, it finds substring matches inside a given string and finding dictionary strings that match the pattern defined by a regular expression.
You can replace all occurrences of a specified string with another string in Java.
Java API Installation
You can use Java API directly in your Maven Projects with simple configuration steps in pom.xml:
- Add Aspose Maven repository in repositories section.
- Define Java API dependency in dependencies section.
How to open and edit a DOCX document in Java
- Add Java dependency.
- Go to the Aspose Cloud Dashboard.
- Create a new Account to access all applications and services or Sign In to your existing account.
- Click on Applications in the left menu to get Client Id and Client Secret.
- Upload a DOCX file to the Cloud Storage or use directly in the request body.
- Check Developer Guide to edit a DOCX file in Java.