It seems you are experiencing issues with the transition from using HideComments to CommentDisplayMode in the WordProcessingLoadOptions. The change in behavior you are observing could be due to differences in how these two properties handle comments in the document.
In your previous implementation, you used HideComments = true, which effectively hid all comments in the document. With the new approach, setting CommentDisplayMode to WordProcessingCommentDisplay.Hidden should ideally provide similar functionality. However, if the output is not as expected, it may be worth checking the following:
Ensure Proper Versioning: Make sure you are using the correct version of the library that supports CommentDisplayMode. Since you mentioned using GroupDocs.Total 25.2, ensure that you have updated to a version that fully supports the new property.
Review the Documentation: Sometimes, changes in the API can lead to different behaviors. It might be helpful to review the latest documentation for any notes on CommentDisplayMode and how it interacts with other settings.
Sample Code: Here’s a sample code snippet that demonstrates how to use CommentDisplayMode:
var convLoadOpts = new WordProcessingLoadOptions
{
CommentDisplayMode = WordProcessingCommentDisplay.Hidden
};
var settings = new ConverterSettings();
settings.FontDirectories.Clear(); // Clear font directories
Func<LoadContext, LoadOptions> fnLoadOpts = (loadContext) => convLoadOpts;
using (var conv = new Converter(documentPath, fnLoadOpts, () => settings))
{
var options = new PdfConvertOptions();
conv.Convert("Conversion.pdf", options);
}
Testing Different Modes: If hiding comments is not working as expected, you might want to test other values for CommentDisplayMode, such as WordProcessingCommentDisplay.Show or WordProcessingCommentDisplay.ShowInMargin, to see how they affect the output.
If the issue persists, consider reaching out to the support team with specific details about the differences in output, as they may provide insights or fixes for the behavior you are encountering.
For further reference, you can check the example code provided in the GroupDocs GitHub repository, which demonstrates how to hide comments during conversion here.
If you have any more questions or need further assistance, feel free to ask!
@Clemens
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CONVERSIONNET-7594
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
I have to reopen this issue unfortunately.
When converting only one Page (PagesCount=1) to PNG, it does not respect the “CommentDisplayMode” option set to hidden, and still renders comments.
var fileExtension = Path.GetExtension(documentPath);
var possibleLoadOptions = Converter.GetPossibleConversions(fileExtension);
var loadOptions = possibleLoadOptions.LoadOptions;
if (loadOptions is WordProcessingLoadOptions wordLoadOpts)
{
wordLoadOpts.CommentDisplayMode = WordProcessingCommentDisplay.Hidden;
}
Func<LoadContext, LoadOptions> fnLoadOpts = (loadContext) => loadOptions;
using (var conv = new Converter(documentPath, fnLoadOpts))
{
var options = new ImageConvertOptions()
{
Format = FileTypes.ImageFileType.Png,
PageNumber = 1,
//PagesCount = int.MaxValue
PagesCount = 1
};
conv.Convert("Conversion.png", options);
}
When using PagesCount = int.MaxValue, then the comments are hidden as configured.
I was using the latest version 25.7 of GroupDocs.Total.NetFramework for testing.
@Clemens
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): TOTALNET-286
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.