public class CommentDisplayMode
extends java.lang.Object
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");
| Modifier and Type | Field and Description |
|---|---|
static int |
HIDE
No document comments are rendered.
|
static int |
length |
static int |
SHOW_IN_ANNOTATIONS
Renders document comments in annotations.
|
static int |
SHOW_IN_BALLOONS
Renders document comments in balloons in the margin.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String commentDisplayModeName) |
static java.lang.String |
getName(int commentDisplayMode) |
static int[] |
getValues() |
static java.lang.String |
toString(int commentDisplayMode) |
public static int HIDE
public static int SHOW_IN_BALLOONS
public static int SHOW_IN_ANNOTATIONS
public static int length