Aspose.Words for Java is a feature rich document processing API to create, modify, convert, render and print files in all formats supported by Microsoft Word and more. It does not depend on Microsoft Word or other third-party applications. However Aspose.Words for Java provides features that Word supports – compare documents, find and replace text, split a document into parts, mail merge fields, render pages, format all document elements and so on. You can see the full list of Aspose.Words features in our documentation.
Aspose.Words API supports all popular loading and saving formats. You can save or convert Word documents to fixed-layout formats – PDF or XML, as well as convert your Word files to popular image or multimedia formats – JPEG, SVG, GIF and others. Check out the full list of supported formats.
At a Glance
Some of the advanced capabilities of API.
- Business Objects
- LINQ Reporting Engine
- PNG, JPEG, BMP, GIF
- XPS, OpenXPS
- PDF, PDF/A-1b, PDF/A-1b
- PostScript (PS)
- XamlFixed, XamlFlow or XamlFlowPack
API can be used in any Java-based applications developed on Windows Unix/Linux and Mac platforms.
- JSP/JSF Application
- Desktop Application
Supported File Formats
Aspose.Words for Java supports the most popular Word Processing document formats .
- Microsoft Word: DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM FlatOPC, FlatOpcMacroEnabled, FlatOpcTemplate, FlatOpcTemplateMacroEnabled
- OpenOffice: ODT, OTT
- WordprocessingML: WordML
- Web: HTML, MHTML
- Text: TXT
- Fixed Layout: PDF, PDF/A, XPS, OpenXPS, PostScript (PS)
- Graphics: TIFF, JPEG, PNG, BMP, SVG, EMF, GIF
- Web: HtmlFixed
- Others: PCL, EPUB, XamlFixed, XamlFlow, XamlFlowPack
Advanced Java Words API Features
You can try some of the popular Aspose.Words features on the online application pages:
Remove a single page or multiple pages from a document
Delete blank pages in documents
You can try all Aspose.Words online applications.
Also check out tehh documentation for the most popular features in Aspose.Words:
Please note that the list is not complete and you can find more features and descriptions in the documentation.
Convert a Document in Java
The ability to quickly, reliably and efficiently save a file into different formats with a high degree of precision is the reason most of our customers choose Aspose.Words.
Java API allows you to convert a file from one supported format to another with just two lines of code. It is so simple!
Convert DOC to DOCX – Java
// Load DOC file to be converted Document wpd = new Document(dir + "template.doc"); // Convert DOC to DOCX wpd.save(dir + "output.docx", SaveFormat.DOCX);
Convert HTML to DOCX – Java
// Load HTML file to be converted Document wpd = new Document(dir + "template.html"); // Convert HTML to DOCX wpd.save(dir + "output.docx", SaveFormat.DOCX);
Convert RTF to PDF – Java
// Load RTF file to be converted Document wpd = new Document(dir + "template.rtf"); // Convert RTF to PDF wpd.save(dir + "output.pdf", SaveFormat.PDF);
See more details on the Conversion page.
Render, View or Print Files using Java
Aspose.Words for Java has its own rendering engine specifically designed to render and print documents with highest fidelity.
On the documentation pages you can find out how to:
Reporting and Mail Merge
Aspose.Words for Java is a full featured reporting solution. You can design reports in Microsoft Word and then allow the API to populate files with data from a variety of data sources while keeping the mail merge settings preserved.
Aspose.Words for Java allows you to use standard Microsoft Word mail merge fields in reports. Additionally, you can use library extended syntax for mail merge fields to perform more complex tasks during the merging operations such as inserting images or repeatable regions.
Programming with Documents Using Document Object Model (DOM)
Aspose.Words for Java helps developers to create, build, modify, parse and examine loaded files using our intuitive Document Object Model (DOM) that consists of over 100 classes. This object model allows developers to programmatically manipulate various elements such as Sections, Headers, Footers, Paragraphs, Lists, Tables, Text, Fields, Hyperlinks, Bookmarks, Images, Smart tags, Shapes, Custom XML and more.
Furthermore, all drawing objects, including shapes, text boxes, images, OLE objects and controls are supported through this document object model, allowing you to perform many tasks such as inserting watermarks on pages or extracting images from a pre-existing file.
Aspose.Words for Java provides useful utility features, for example, join or split files, find and replace text, protect or unprotect files, modify properties and insert HTML fragments into documents. All of these features are available via easy-to-use APIs to help developers perform complex operations without worrying about the file format specifications.
Join two documents – Java
// Load source & destination files Document srcDoc = new Document(dir + "source.docx"); Document dstDoc = new Document(dir + "destination.docx"); // Set the appended file to start from a new page srcDoc.getFirstSection().getPageSetup().setSectionStart(SectionStart.NEW_PAGE); // Append the source file using its original styles dstDoc.appendDocument(srcDoc, ImportFormatMode.KEEP_SOURCE_FORMATTING); // Save final result dstDoc.save(dir + "output.docx");
No Need for Microsoft Office Automation
You can work with documents programmatically without installing any other third-party application. This is possible because the library is built using managed code. Therefore, you do not need to install Microsoft Office or Microsoft Word on your computer to work with Word formats. It is a perfect alternative to Microsoft Office Automation in terms of supported features, security, stability, scalability, speed, and price.
What People Are Saying
Don't just take our word for it. See what users have to say about Aspose.Words APIs.
With Aspose.Words, we increased efficiency at the organizational processes because we reduce the time spent in technical support activities. Now we can say that we are only focused on our core business. Paulo Lopes | Xpand IT, UK
Working with Aspose.Words has been a very satisfying and easy to implement solution. One of the best features being the quick time in which large documents are generated. Tom Daniels | Pill Creek Publishing, UK
Aspose.Words has saved us a lot of time, effort and money. It’s given our customers good reliable import/export functionality so they can open their old document in WriteOnline. Andrew Burt | Crick Software Ltd, USA