comment_display_mode property

LayoutOptions.comment_display_mode property

Gets or sets the way comments are rendered. Default value is CommentDisplayMode.SHOW_IN_BALLOONS.

def comment_display_mode(self) -> aspose.words.layout.CommentDisplayMode:

def comment_display_mode(self, value: aspose.words.layout.CommentDisplayMode):


Note that revisions are not rendered in balloons for CommentDisplayMode.SHOW_IN_ANNOTATIONS.


Shows how to show comments when saving a document to a rendered format.

doc = aw.Document()
builder = aw.DocumentBuilder(doc)

builder.write("Hello world!")

comment = aw.Comment(doc, "John Doe", "J.D.",
comment.set_text("My comment.")

# SHOW_IN_ANNOTATIONS is only available in Pdf1.7 and Pdf1.5 formats.
# In other formats, it will work similarly to Hide.
doc.layout_options.comment_display_mode = aw.layout.CommentDisplayMode.SHOW_IN_ANNOTATIONS + "Document.show_comments_in_annotations.pdf")

# Note that it's required to rebuild the document page layout (via Document.update_page_layout() method)
# after changing the "Document.layout_options" values.
doc.layout_options.comment_display_mode = aw.layout.CommentDisplayMode.SHOW_IN_BALLOONS
doc.update_page_layout() + "Document.show_comments_in_balloons.pdf")

See Also