Markup Annotations
- 2 minutes to read
Markup annotations allow users to review and comment on PDF documents. They identify content that requires attention and display comments directly on a page.
The PDF Document API supports the following text markup annotation types:
| Annotation | Description |
|---|---|
| Text | Adds a sticky note. |
| Free Text | Places text directly on a PDF page. |
| Caret | Marks text insertion points. |
| Redact | Removes sensitive information from a PDF document. |
| Rubber Stamp | Displays predefined or custom stamps on a PDF page. |
Create a Markup Annotation
Create a markup annotation, configure its properties, and add it to the page’s annotation collection.
The following code snippet creates a sticky note and adds it to the first page:

// Get the first page in the document.
Page page = pdfDocument.getPages().getFirst();
TextAnnotation annotation = new TextAnnotation(new RectangleF(50, 430, 24, 36));
annotation.setTitle("Brian Zetc");
annotation.setContent("Please review this paragraph.");
annotation.setColor(PdfColor.getLightGray());
page.getAnnotations().add(annotation);
Add Comments
Call the MarkupAnnotation.addReply() method to add a comment to a markup annotation.
The following code snippet adds a reply to a text annotation:
annotation.addReply(
page,
"Alice Brown",
"Thank you!");
Note
The PDF Document API automatically removes replies when you remove the parent annotation.
Add Reviews
Call the MarkupAnnotation.addReview() method to add a review to a markup annotation.
The following code snippet adds a review to a text annotation:
annotation.addReview(
page,
"Cardle Anita L",
ReviewStatus.ACCEPTED);
Use the getReviewHistory(Page page) method to get the review history.
Call the clearReviews(Page page) method to remove all reviews.