Spire.Doc for Java

Java Word Library – Create Read Modify Print Convert Word Documents in Java

  • Overview
  • Features
  • Support
  • What's New
  • Live Demo

Professional Java Library
to Process Word documents

Over 1,000,000 Developers Are Already Using Our Libraries
To Create Their Amazing Applications.

Spire.Doc for Java is a professional Word API that empowers Java applications to create, convert, manipulate and print Word documents without dependency on Microsoft Word.


By using this multifunctional library, developers are able to process copious tasks effortlessly, such as inserting images, shapes, lists, hyperlink, pages, digital signature, WordArt, variables, bookmark, watermark, barcodes, page breaks, section breaks, math equations, and setting header and footer, creating table, setting background image, setting fonts, adding footnote/endnote etc.


In addition, Spire.Doc for Java supports file format conversions from Word to PDF, XPS, XML, RTF, TXT, Excel, image (JPG, PNG and SVG), EPUB, HTML, PostScript, ODT, PCL (Printer Command Language), WordML and many more. Furthermore, it supports to convert RTF to HTML/image/PDF, convert HTML to PDF/images/Word, convert XML/ODT to PDF, convert Markdown to Word/PDF in high quality.

  • Convert

  • Compare

  • Extract

  • eSign

  • Watermark

  • Replace

  • Mail Merge

  • Highlight

  • Header

  • Form

Convert Word to PDF

PDF files are preferred over Word documents because they are safe, simple to open, and easy to manage on any device. PDF is the most popular file format that users would convert Word to.

Compare Documents

If you receive two nearly-identical Word documents, the ideal way to determine whether there are any differences between them is to compare the two documents.

Extract Text and Images

When you just need to get the information in a Word document regardless of its format and structure, you can simply extract the text and images from the document.

Digitally Sign Documents

A digital signature provides assurances about the validity and authenticity of your Word documents. Once a Word document is digitally signed, any changes to the document will invalidate the signature.

Add a Watermark

A watermark is used to declare confidentiality, copyright, or other attributes of the document, or as a decoration to make the document more attractive. You can add either text or image watermarks to Word documents.

Replace Text

The ability to replace existing text (or placeholders) in a Word document makes it possible for programmers to quickly generate Word reports or documents based on a template.

Mail Merge

Mail Merge is a handy feature that allows you to quickly produce multiple documents, such as letters or emails, using information stored in a list, spreadsheet or database.

Find and Highlight

If you want to emphasize some words, you can find and highlight them in a bright color so that the readers could catch them easily.

Headers and Footers

Headers and footers are useful for including information that you want to appear on every page of a document, such as company logo or page number.

Create a Form

Form fields make it easier to collect information. Users can enter information by choosing an item from a drop-down list, inserting text in a combo box, or checking a check box.

JAVA

Standalone Java Component

100% independent Java Word class library
Doesn't require Microsoft Office installed on system.

VERSION

  • Word 97-03
  • Word 2007
  • Word 2010
  • Word 2013
  • Word 2016
  • Word 2019

OPERATION

Powerful Toolset, Multichannel Support

  • Mail Merge, Create Field, Fill Field, Update Field

  • Protect, Encrypt, Decrypt

  • Find Replace Highlight

  • Insert, Edit, remove bookmark

  • Image and Shape

  • Merge and Split Word document

  • Header and Footer

  • Insert, Reply, remove comment

  • Create & Update Table

  • Print Word Document

  • Create, Modify, Remove hyperlink

CONVERSION

Convert File Documents with High Quality

  • PDF

  • XPS

  • EPUB

  • SVG

  • PCL

  • Image

Doc/Docx

  • ODT

  • XML

  • HTML

  • RTF

  • TXT

  • PNG

  • BMP

  • JPEG

MAIN FUNCTION

Only Spire.Doc for Java, No Microsoft Office

Spire.Doc for Java is a totally independent Word component, Microsoft Office is not required in order to use Spire.Doc for Java.

High Quality File Conversion

Spire.Doc for Java allows converting popular file formats like HTML, RTF, ODT, TXT, WordML, WordXML to Word and exporting Word to commonly used file formats such as PDF, XPS, XML, RTF, TXT, image (JPG, PNG and SVG), EPUB, HTML, ODT, PCL (Printer Command Language), WordML in high quality. Moreover, conversion between Doc and Docx is supported as well.

Support a Rich Set of Word Elements

Spire.Doc for Java supports a rich set of Word elements, including section, header, footer, footnote, endnote, paragraph, list, table, text, font, TOC, form field, mail merge, hyperlink, bookmark, watermark, barcodes, image, style, shape, textbox, OLE, WordArt, background settings, digital signature, document settings, protection and many more.

Easy Integration

Spire.Doc for Java can be easily integrated into Java applications.

Commercial Edition $999

Compared with Free Spire.Doc for Java, the commercial edition of Spire.Doc for Java has no limitation on the number of paragraphs and tables and is more comprehensive in processing Word files.


Free Edition $0

Free Spire.Doc for Java is limited to 500 paragraphs and 25 tables. This limitation is enforced during reading or writing files. When converting Word documents to PDF and XPS files, you can only get the first 3 pages of PDF file.

GET STARTED

Free Trials for All Advanced Solutions

Here is a brief summary of Spire.Doc for Java features.

Generating, Writing, Editing and Saving

Spire.Doc for Java enables quick generating, saving, writing and editing Word documents.
  • Generate and save Word documents (Word 97-2003, Word 2007, Word 2010, Word 2013, Word 2016 and Word 2019).
  • Load and save document with macros, including .doc (Word 97-2003) document with macros and .docm(Word 2007, Word 2010, Word 2013, Word 2016 and Word 2019) document.
  • Write and edit text and paragraphs.

Converting

Spire.Doc for Java enables converting Word documents to most common and popular formats.
  • Bi-directional conversion Doc-Docx: Convert .doc document (Word 97-2003) to .docx document (Word 2007, Word 2010, Word 2013, Word 2016 and Word 2019) and vice versa.
  • Bi-directional conversion Doc(x)-RTF: Convert .doc(x) document to RTF (Rich Text Format) and vice versa.
  • Bi-directional conversion Doc(x)-TXT: Convert .doc(x) document to TXT (Plain Text) and enable to load TXT file and save as .doc(x) document.
  • Bi-directional conversion Doc(x)-HTML: Convert .doc(x) document to HTML file and enable to load HTML file and save as .doc(x) document.
  • Bi-directional conversion Doc(x)-Dot: Convert .doc(x) document to Dot and vice versa.
  • Bi-directional conversion Doc(x)-XML: Convert .doc(x) document to XML and enable to load XML file and save as .doc(x) document.
  • Unidirectional Conversion Doc(x)-XPS: Convert .doc(x) document to XPS document.
  • Unidirectional Conversion: Doc(x)-EPUB: Convert .doc(x) document to EPUB (Digital Publishing).
  • Unidirectional Conversion: Doc(x)-PDF: Convert .doc(x) document to PDF in high quality, including contents and formats.

Inserting, Editing and Removing Objects

Spire.Doc for Java enables to inserting, editing and removing external objects in Word.

Formatting

Spire.Doc for Java enables formatting contents in documents, including character, paragraphs, pages and whole document.
  • Format all characters in document, including fonts, sizes, colors, effects etc.
  • Format paragraphs, including built-in styles, indents, spacing, bullets, alignment, headings and number list style etc.
  • Format Word tables, including cell fonts and colors, cell background color, cell alignment, cell borders and column width/row height setting.
  • Format Word page, including page breaks, border, margins, paper size and orientation.
  • View document with different document view types, zoom percent and zoom types.

Mail Merge

Spire.Doc for Java enables executing mail merge function to create records, orders and reports.
  • Perform simple mail merge fields (name and value) to create single item.
  • Execute mail merge to create a group of data records with connecting customized data source.

Frequently asked question for Spire.Doc for Java of technical and function issues.

We guarantee one business day Forum questions Reply.

We guarantee one business day E-mail response.

Free Customized service for OEM Users.

Skype name: iceblue.support

Apply for a Free Trial License File.

To help you get started quickly, we offer free customized demos to our customers. Please contact [email protected] for the free demo. Make sure the demo you want meets the below requirements.
  • It relates to our components stored on E-iceblue online store.
  • It costs less than 2 hours for us to complete it. If it costs more than 2 hours, please contact our [email protected]

If you have tried out Spire.Doc for Java and found it useful, please consider sharing your experience with others. By sharing your testimonial with us, you will not only help others to make the right decision but will also to earn rewards from us. Please send your testimonials to [email protected].

This is the list of changelogs of Spire.Doc for Java New release and hotfix. You can get the detail information of each version's new features and bug solutions.

Download Spire.Doc for Java to start a free trial:

Version: 13.4.1

Category ID Description
Bug SPIREDOC-11117 Optimizes the time-consuming issue of Word to PDF conversion.
Bug SPIREDOC-11123 Fixes the issue that the program threw the "AssertionError" exception when converting Word documents to HTML.
Bug SPIREDOC-11139 Fixes the issue that the program threw an exception when retrieving content of the saved documents.
Bug SPIREDOC-11144 Fixes the issue that the program threw the "NullPointerException" exception when converting Word documents to HTML.
Bug SPIREDOC-11153 Fixes the issue that the result was incorrect when obtaining OLE NativeDataBytes.
Bug SPIREDOC-11162 Fixes the issue that the layout was incorrect when converting Word to PDF.

Version: 13.3.0

Category ID Description
New feature SPIREDOC-10918 Support setting default font, which are only used when the requested font is not found in the font cache.
doc.setDefaultSubstitutionFontName("simsun");
Bug SPIREDOC-11058 Fixes the issue that the images were unclear when converting Word to HTML.
Bug SPIREDOC-11096 Fixes the issue that the program hangs when adding table of contents in Word
Bug SPIREDOC-11098 Fixes the issue that the program threw the "ClassCastException" exception thrown when converting Word to HTML stream.
Bug SPIREDOC-11103 Fixes the issue that the GIF images were lost when converting Word to HTML. 
Bug SPIREDOC-11107 Fixes the issue that the program threw the "NullPointerException" exception when converting Word to PDF.
Bug SPIREDOC-11124 Fixes the issue that the program threw the "OutOfMemoryError" exception when converting Word to HTML.

Version: 13.2.1

Category ID Description
Bug SPIREDOC-11067 Fixes the issue that the program threw the "NullPointerException" when adding HTML content to a StructureDocumentTag.
Bug SPIREDOC-11074 Fixes the issue that extra square boxes appeared in bulleted lists when converting Word to PDF.
Bug SPIREDOC-11080 Fixes the issue that the program threw the "Specified argument was out of the range of valid values" error when loading a Word document.
Bug SPIREDOC-11088 Fixes the issue that the program threw the "NullPointerException" when calling Document.updateTableOfContents() method.
Bug SPIREDOC-11089 Fixes the issue that the word count statistics were incorrect.
Bug SPIREDOC-11091 Optimizes the performance of the comparison feature.

Version: 13.1.3

Category ID Description
New feature SPIREDOC-10870 Synchronizes methods to track the addition, deletion, and changes of document elements and text content.
public void startTrackRevisions(String author);
public void startTrackRevisions(String author, Date date);
public void stopTrackRevisions();
New feature SPIREDOC-11038 Supports the function of obtaining and enabling 'Do not add space between paragraphs of the same style'.
paragraph.getFormat().getNoSpaceBetweenParagraphsOfSameStyle();
paragraph.getFormat().setNoSpaceBetweenParagraphsOfSameStyle(true);
New feature SPIREDOC-10951 Supports changing bookmark name.
bookmark.setName(String bookmarkName);
Bug SPIREDOC-10725 Fixes the issue that the results were incorrect when adding TOC and updating SEQ domains.
Bug SPIREDOC-10848 Fixes the issue that the images were blurred when converting HTML to images.
Bug SPIREDOC-10887 Fixes the issue of incorrect color and extra spaces in the list text when converting Word to HTML.
Bug SPIREDOC-10891 Fixes the issue that the content was lost when converting Word to PDF.
Bug SPIREDOC-10903 Fixes the issue that extra references content appeared when updating TOC.
Bug SPIREDOC-10905 Fixes the issue that the formulas were incorrect when converting Word to HTML on Linux system.
Bug SPIREDOC-10925 Fixes the issue that the TOC updated incorrectly.
Bug SPIREDOC-10931 Fixes the issue that the table content overflowed the border when converting Word to HTML.
Bug SPIREDOC-10932 Fixes the issue that the numbering was incorrect when converting Word to HTML.
Bug SPIREDOC-10978 Fixes the issue that the fonts were incorrect when converting HTML to PDF.
Bug SPIREDOC-11000 Fixes the issue that the line height was incorrect when converting HTML to Word.
Bug SPIREDOC-11006 Fixes the issue that the program threw the exception 'UnsupportedOperaException' when loading Markdown file stream.
Bug SPIREDOC-11007 Fixes the issue that the program threw the exception "Collection was modified; enumeration operation may not execute" when converting Word to PDF.
Bug SPIREDOC-11040 Fixes the issue that the program threw the exception "Not supported delivering content between bookmarks in different paragraphs" when replacing bookmark content.

Version: 12.12.21

Category ID Description
Bug SPIREDOC-10938 Fixes the issue that there are incorrect characters when converting a Word document to a PDF document.

Version: 12.11.9

Category ID Description
Bug SPIREDOC-10245 Fixes the issue that the layout of some content was incorrect when converting Word to PDF.
Bug SPIREDOC-10538 Fixes the issue that the bookmarks cannot be redirected when converting Word to PDF.
Bug SPIREDOC-10610 Fixes the issue that the program threw an "IllegalStateException" error when converting Word to PDF.
Bug SPIREDOC-10872 Optimizes the time-consuming issue of adding images in Word.
Bug SPIREDOC-10909
SPIREDOC-10940
Fixes the issue that the program threw a 'NullPointerException' error while comparing documents.
Bug SPIREDOC-10923 Fixes the issue that the program threw a 'ClassCastException' error while loading a document.
Bug SPIREDOC-10926 Fixes the issue that the program threw an "IllegalArgumentException" error while comparing documents.
Bug SPIREDOC-10929 Fixes the issue that the permission protection was lost after multiple operations on documents with restricted editing.
Bug SPIREDOC-10936 Fixes the issue that the program threw an "Can't create formfield with 'Check1' name" error when converting RTF to PDF.
Bug SPIREDOC-10960 Fixes the issue that the program threw the error "Index is less than 0 or more than or equal to the list count" when using updateTableOfContents() method.
Bug SPIREDOC-10962 Fixed the issue that the formula comparison effect was incorrect.

Version: 12.11.0

Category ID Description
Bug SPIREDOC-10693 Fixes the issue that the highlighting effect was incorrect when searching.
Bug SPIREDOC-10726 Fixes the issue that the table borders were not displaying in WPS after saving doc as docx.
Bug SPIREDOC-10747 Fixes the issue that the program threw an "IllegalArgumentException" when converting Word to PDF.
Bug SPIREDOC-10755 Fixes the issue that the border properties of the table changed.
Bug SPIREDOC-10794 Fixes the issue that the column widths in tables were inconsistent after converting Word to HTML.
Bug SPIREDOC-10833 Fixes the issue that the program threw an "Unexpected table container" error when converting Word to PDF.
Bug SPIREDOC-10861 Fixes the issue that the layout was inconsistent when converting Word to HTML. 
Bug SPIREDOC-10862 Fixes the issue that the images were lost when converting RTF to PDF.
Bug SPIREDOC-10864 Fixed the issue of incorrect effect after accept the revisions.
Bug SPIREDOC-10868 Fixes the issue that the program threw the error "The string contains invalid characters" when loading Word.
Bug SPIREDOC-10822 Fixed the issue of incorrect effect when adding LaTeX formula. 

Version: 12.10.3

Category ID Description
Bug SPIREDOC-10795 Fixes issue that the TOC field was updated incorrectly.
Bug SPIREDOC-10800 Fixes the issue that the Chinese characters were garbled after converting Markdown to Word.
Bug SPIREDOC-10801 Fixes the issue that the list numbers were lost after converting Markdown to Word.

Version: 12.9.4

Category ID Description
Bug SPIREDOC-10740 Optimizes the speed of converting Word documents to PDF documents.
Bug SPIREDOC-10457 Fixes the issue that the text layout was incorrect after converting Word documents to PDF documents.
Bug SPIREDOC-10791 Fixes the issue that the created table of contents field was not updated correctly.
Bug SPIREDOC-10813 Fixes the issue that SimSun font was replaced with Times New Roman font after converting Word documents to PDF documents.
Bug SPIREDOC-10821 Fixes the issue that the program threw "Cannot find any fonts in specified font sources" exception when converting Word documents to PDF documents under the system environment where fonts were not installed.
Bug SPIREDOC-10825 Fixes the issue that the program threw java.lang.NullPointerException when using Map type parameters in MailMergeDataTable class.

Version: 12.9.0

Category ID Description
New feature SPIREDOC-7237 Supports determining if a bookmark is hidden with the new method, "bookmark.isHidden()".
New feature SPIREDOC-10287 Supports updating the character count with the new method, "document.updateWordCount()".
New feature SPIREDOC-10771 Supports embedding font files into the document when converting Word documents to HTML documents with the new method, "document.getHtmlExportOptions().setFontEmbedded(true)".
Bug SPIREDOC-10641 Fixes the issue that line spacing became inconsistent after replacing bookmark content.
Bug SPIREDOC-10671 Fixes the issue that regular format Latex formula code added to the document was converted into italic style. 
Bug SPIREDOC-10676 Fixes the issue that removing the italic style from Latex formulas did not take effect.
Bug SPIREDOC-10739 Fixes the issue that the set edit restriction password did not work in MS Word or WPS tools. 
Bug SPIREDOC-10757 Fixes the issue that garbled content appeared when converting Word documents to PDF documents.
Bug SPIREDOC-10769 Fixes the issue that the program hung when converting Markdown documents to Word documents.
Bug SPIREDOC-10771 Fixes the issue that an occasional exception occurred during stress testing of the merge mail function.
Request free customized demo just for you.

Tab 1

Upload

Maximum file size: 1 MB. Files accepted: doc, docx, txt, rtf.
Click here to browse files.
fileerrors

Convert to

Source file:
filename
Target file type:

Tab 2

Upload

Maximum file size: 1 MB. Files accepted: doc, docx, txt, rtf.
Click here to browse files.
fileerrors

Convert to

Source file:
filename
Search Text:

Tab 3

Tab 4

Data

e-iceblue

Option

Header Back Color:
Row Back Color:
Alternation Back Color:
Border Color:
downloads

Tab 5

Agreement Start Date:
Agreement End Date:
Agreement Extension Date:
Documentation Start Date:
Documentation End Date:
downloads

Tab 6

Upload

Maximum file size: 1 MB. Files accepted: doc, docx, txt, rtf.
Click here to browse files.
Source file:
filename
fileerrors

Set text watermark

Text:
Font:
Font Size:
Color:
downloads

Set image watermark

Image:
Click here to browse files
downloads

If you don't find the function you want, please fill in a form to request a free demo from us. Make sure the demo you want meets the following requirements:

  • It is a small project that implements a particular scenario.
  • It relates to our libraries stored on E-iceblue online store.
  • It costs less than 2 hours for us to complete it.
  • It is not a bug report.
  • It is not a feature request.