Hello Andrey,
My expectation is that when the comment options is turned on:
saveOptions.getNotesCommentsLayouting().setCommentsPosition(CommentsPositions.Right);
Then:
- If the presentation contains no comments it would render the document as-is without the comment panel on the right. Same as with
CommentsPositions.None
.
- If the presentation contains comments it would render the comment panel only on those slides where there are comments.
I have found a work-around for now. I check if the document has comments and only then enable the comments rendering. But it would be nice the Aspose Slides could handle it automatically.
if (hasComments(presentation)) {
saveOptions.getNotesCommentsLayouting().setCommentsPosition(CommentsPositions.Right);
}
else {
saveOptions.getNotesCommentsLayouting().setCommentsPosition(CommentsPositions.None);
}
private boolean hasComments(Presentation presentation) {
ICommentAuthorCollection authors = presentation.getCommentAuthors();
if (authors == null) {
return false;
}
for (ICommentAuthor author : authors) {
ICommentCollection comments = author.getComments();
if (comments != null && comments.size() > 0) {
return true;
}
}
return false;
}
Here is an example. The presentation has no comments (PravsJ_Rich_Poor.pps.7z (74.7 KB)
) but it still shows the empty blue box on each slide.
image.jpg (152.4 KB)