Print Word Document with Comments using Java

This quick guide contains information on how to print Word document with comments using Java. It has details to create or load a Word file with comments and then customize it for printing the comments along with the document. You will print DOCX comments using Java with the help of a list of steps and given sample code in the subsequent section.

Steps to Print Document with Comments using Java

  1. Set IDE to refer to the Aspose.Words for Java to render DOCX comments
  2. Import the necessary modules and classes from the library
  3. Load the license to avoid watermarks and other limitations
  4. Optionally, create a Word file, add some text, and insert comments
  5. Otherwise, load an existing Word document with text and some comments in it
  6. Get access to the Document.LayoutOptions.RevisionOptions for printing comments
  7. Set all the desired parameters of the revision options to customize the rendered comments
  8. Save the resultant Word file as a PDF

The above steps summarize the process to render DOC comments using Java. Import the necessary classes, create or load a World file with some text and comments in it. Get access to the LayoutOptions.RevisionOptions and set details of information to be shown in the balloon, measurement unit, and position of the comments bar on the printout.

Code to Print DOC Comments using Java

This code demonstrates how to print document with comments using Java. The ShowInBalloons enumerator defines what information is to be placed online and which information is to be displayed inside the balloon. Similarly, a variety of options are available for the placement of the revision bar position, such as left, right, center, inside, or outside.

This article has described the process of printing a Word document with comments in a PDF file. To merge Markdown files in a Word file, refer to the article on Merge MD files in Java.