This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dotnet/csharp/conversion/word-document-to-pdf-including-comments.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Converting a Word document to PDF while preserving comments

Converting Word documents to PDF with comments preserved — whether for contracts, technical specifications, or regulatory documents — ensures that all stakeholder input remains accessible in the final format.

How Nutrient helps you achieve this

Nutrient .NET SDK handles DOCX-to-PDF conversion with comment preservation. With the SDK, you don’t need to worry about:

  • Parsing Word document structures
  • Managing comment extraction and placement
  • Handling markup mode configuration
  • Complex annotation conversion logic

Instead, Nutrient provides an API that handles all the complexity behind the scenes, letting you focus on your business logic.

Complete implementation

Below is a complete working example that demonstrates DOCX-to-PDF conversion with comments preserved. This line sets up the C# application. The using directive brings in the Nutrient SDK namespace:

using Nutrient;

This line opens the Word document containing comments. The using declaration(opens in a new tab) ensures the document is automatically closed when it goes out of scope, preventing resource leaks:

try
{
using Document document = Document.Open("input_with_comments.docx");

This line configures the markup mode through the document’s Word settings. Four modes are available:

  • AllMarkup — Show all markups in different colors, underlined/struck through. Comments are converted to annotations. This is the default behavior.
  • SimpleMarkup — Show the document as if all changes were accepted. Comments are converted to annotations.
  • NoMarkup — Show the document as if all changes were accepted. Comments aren’t converted to annotations.
  • Original — Show the document as if none of the changes were made (as if all changes were rejected). Comments aren’t converted to annotations:
document.Settings.WordSettings.MarkupMode = DocumentMarkupMode.AllMarkup;

This block exports the document to PDF with all comments preserved as annotations. The try-catch block handles potential errors using NutrientException:

document.ExportAsPdf("output.pdf");
Console.WriteLine("Successfully converted with comments preserved");
}
catch (NutrientException e)
{
Console.Error.WriteLine($"Error: {e.Message}");
Environment.Exit(1);
}

Conclusion

The conversion logic consists of three steps:

  1. Open the document.
  2. Configure the markup mode.
  3. Export as PDF.

Nutrient handles Word document parsing and comment conversion so you don’t need to understand document internals or manage annotation placement manually.