Hello,
Is there an option to export a presentation to PDF with comments but only if the comments actually exist in the document? My issue is that when I use this option:
PdfOptions saveOptions = new PdfOptions();
saveOptions.getNotesCommentsLayouting().setCommentsPosition(CommentsPositions.Right);
it would render the comments fine. But if the document contains no comments, it would still render a blue empty box on the right. Is there an option to automatically hide the comments box if there are no comments?
@igor.rogov,
Thank you for posting the question.
Please clarify the following. In the case where only some slides contain comments (rather than the entire document), what PDF output do you expect?
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)
@igor.rogov,
Thank you for the explanation. Our development team will consider such an improvement.
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): SLIDESJAVA-39136
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.
@igor.rogov,
Thank you for using Aspose.Slides.