CommentDisplayMode

Inheritance: java.lang.Object

public class CommentDisplayMode

Specifies the rendering mode for document comments.

Examples:

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


 Document doc = new Document();
 DocumentBuilder builder = new DocumentBuilder(doc);

 builder.write("Hello world!");

 Comment comment = new Comment(doc, "John Doe", "J.D.", new Date());
 comment.setText("My comment.");
 builder.getCurrentParagraph().appendChild(comment);

 // ShowInAnnotations is only available in Pdf1.7 and Pdf1.5 formats.
 // In other formats, it will work similarly to Hide.
 doc.getLayoutOptions().setCommentDisplayMode(CommentDisplayMode.SHOW_IN_ANNOTATIONS);

 doc.save(getArtifactsDir() + "Document.ShowCommentsInAnnotations.pdf");

 // Note that it's required to rebuild the document page layout (via Document.UpdatePageLayout() method)
 // after changing the Document.LayoutOptions values.
 doc.getLayoutOptions().setCommentDisplayMode(CommentDisplayMode.SHOW_IN_BALLOONS);
 doc.updatePageLayout();

 doc.save(getArtifactsDir() + "Document.ShowCommentsInBalloons.pdf");
 

Fields

FieldDescription
HIDENo document comments are rendered.
SHOW_IN_ANNOTATIONSRenders document comments in annotations.
SHOW_IN_BALLOONSRenders document comments in balloons in the margin.
length

Methods

MethodDescription
fromName(String commentDisplayModeName)
getName(int commentDisplayMode)
getValues()
toString(int commentDisplayMode)

HIDE

public static int HIDE

No document comments are rendered.

SHOW_IN_ANNOTATIONS

public static int SHOW_IN_ANNOTATIONS

Renders document comments in annotations. This is only available for Pdf format.

SHOW_IN_BALLOONS

public static int SHOW_IN_BALLOONS

Renders document comments in balloons in the margin. This is the default value.

length

public static int length

fromName(String commentDisplayModeName)

public static int fromName(String commentDisplayModeName)

Parameters:

ParameterTypeDescription
commentDisplayModeNamejava.lang.String

Returns: int

getName(int commentDisplayMode)

public static String getName(int commentDisplayMode)

Parameters:

ParameterTypeDescription
commentDisplayModeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int commentDisplayMode)

public static String toString(int commentDisplayMode)

Parameters:

ParameterTypeDescription
commentDisplayModeint

Returns: java.lang.String