This short guide explains how to print Word document with comments using C#. It has details to create a document from scratch, add some text with comments and then perform the comments rendering operation. You will get IDE settings, a list of steps, and a sample code to print DOC comments using C#.
Steps to Print Document with Comments using C#
- Set the IDE to use Aspose.Words for .NET to render DOCX comments
- Create an empty Word Document, add text and comments to it or load a Word file with comments
- Access the RevisionOptions from the LayoutOptions in the loaded document
- Set revision option to render insert revisions inline, and delete and format revisions in the balloon
- Set measurement unit to inches
- Set revision bar position to the right of the document
- Save the output file as PDF for printing
The steps summarize the process to render DOCX comments using C#. Import the desired classes and modules from the Aspose.Words library, create or load a Word file with some text and comments in it, and access the RevisionOptions from the LayoutOptions property in the loaded Word file. Set the flag to display comments in a balloon, set the measurement units, set revisions bar position to the right and save the output as printable PDF file.
Code to Print DOCX Comments using C#
This code demonstrates the process to print Word document. The ShowInBalloons defines which revisions out of insertion, deletion, formatting will be displayed in the balloon. You can place the balloon on the left side, center, inside or outside as per your requirements.
This article has taught us the process print the Word document with comments in a PDF file. To merge MD files, refer to the article on Merge MD files in C#.