Converting Word documents with comments to PDF
Word documents often include reviewer comments and tracked changes. Converting these files to PDF without configuring markup settings drops review context from the output.
This guide shows how to convert a DOCX file to PDF while preserving comments and tracked changes based on the selected markup mode.
Prepare the project
Register the SDK license before running conversion operations. For setup details, refer to the getting started with .NET SDK guide.
using GdPicture14;
LicenseManager licence = new LicenseManager();licence.RegisterKEY("");Configure comment preservation
Create a GdPictureDocumentConverter instance:
using GdPictureDocumentConverter converter = new GdPictureDocumentConverter();Set the markup mode to include all markup in the PDF output:
converter.DocumentMarkupMode = DocumentMarkupMode.AllMarkup;The converter supports the following markup modes:
AllMarkup— Shows tracked changes with visual markup and converts comments to annotations.SimpleMarkup— Shows accepted document content and converts comments to annotations.NoMarkup— Shows accepted document content without comment annotations.Original— Shows original content as if tracked changes were rejected, and excludes comments.
Convert the document
Load the DOCX file:
converter.LoadFromFile(@"input_with_comments.docx");For available converter methods, refer to the API reference guide.
Save the PDF output:
converter.SaveAsPDF(@"output.pdf");Handle errors
LoadFromFile and SaveAsPDF return GdPictureStatus values. Use those values in your error-handling flow. For status-handling patterns, refer to the handling errors with .NET SDK guide.
Conclusion
This workflow converts a DOCX file to PDF while preserving review context through configurable markup output.