Nutrient Java SDK

Add PDF annotations and stamps in Java

  • Text markup — highlights, underlines, strikeouts, and squiggly annotations with customizable colors and transparency
  • Stamp annotations with predefined styles: Draft, Approved, Confidential, Final, and Not Approved
  • Shapes (lines, circles, squares), free text, sticky notes, and link annotations
  • Redaction annotations for marking content to be permanently removed

Need pricing or implementation help? Talk to Sales.

PDF ANNOTATIONS IN JAVA

Document document = Document.open("document.pdf");
PdfEditor editor = PdfEditor.edit(document);
PdfPage page = editor.getPage(0);
// Add a highlight annotation.
PdfAnnotationCollection annotations = page.getAnnotationCollection();
annotations.addHighlightAnnotation(
100, 700, 200, 15, "Author", "Important section");
editor.saveAs("annotated.pdf");
editor.close();

USE CASES

When developers reach for this SDK

Automate document review and markup

Add highlights, notes, and comments to PDFs as part of an automated review pipeline. The SDK creates annotations programmatically — no user interface required.

Stamp PDFs with approval status

Apply Draft, Approved, Confidential, Final, or Not Approved stamps to documents in batch. Stamp annotations follow the PDF specification and render consistently in any viewer.

Draw attention to specific content

Use shapes (lines with arrows, circles, squares) and free text to call out sections of a document. Configurable colors, line widths, and line ending styles.

Mark sensitive content for redaction

Add redaction annotations to flag content for permanent removal. Review the marks before applying — once redaction is committed, the underlying content is deleted from the PDF.

PDF annotation capabilities for Java

Text markup annotations

Highlight, underline, strikeout, and squiggly annotations for marking up text. Each supports custom ARGB colors with transparency control.


  • Highlight with translucent color overlays
  • Underline, strikeout, and squiggly annotations
  • Customizable ARGB colors with transparency

Stamp annotations

Apply predefined rubber stamp icons to PDFs — Draft, Approved, Not Approved, Confidential, and Final. Customize colors and positioning.


  • Predefined styles: Draft, Approved, Confidential, Final
  • Customizable color and position on any page
  • Consistent rendering across PDF viewers

Shapes, free text, and notes

Lines with configurable arrow endings, circles, squares, free text placed directly on the page, and sticky note annotations with icon-based comments.


  • Lines with 10+ ending styles (arrows, diamonds, circles)
  • Free text with font family, size, and color control
  • Sticky notes with author, subject, and content

Links and redaction

Add clickable links to external URLs or internal page destinations. Mark areas for redaction — reviewed separately, then permanently applied.


  • External URI links and internal page navigation
  • Destination with page number and x,y coordinates
  • Redaction annotations for marking sensitive content


ADVANCED CAPABILITIES

Beyond basic annotation

The SDK provides fine-grained control over annotation properties — colors with ARGB transparency, line ending styles, coordinate positioning, and font configuration. All operations are programmatic and run server-side without any UI dependency.

Illustration of PDF annotation capabilities
ARGB color with transparency

Set annotation colors using ARGB values. Control the alpha channel for translucent highlights or fully opaque stamps — applied consistently across all annotation types.


Line ending styles

Line annotations support 10+ ending styles per cap — arrows, diamonds, circles, squares, and more. Set start and end caps independently for callout lines and pointers.


Predefined stamp styles

Stamp annotations use the PDF specification’s rubber stamp icons: Draft, Approved, Not Approved, Confidential, and Final. Renderable in any compliant PDF viewer.


Server-side annotation processing

All annotation operations run headless — no GUI, no user interaction. Add, modify, and remove annotations in batch as part of automated Java workflows.


Frequently asked questions

How do I add annotations to a PDF in Java?

Open a document, create an editor, get the page, and access its annotation collection. Add annotations by type — each method takes coordinates, dimensions, author, and content as parameters. Save the result to a new file. See the annotations guide for complete Java examples.

How do I stamp a PDF in Java?

Add a stamp annotation to a page’s annotation collection. Set the stamp style to one of the predefined types: Draft, Approved, Not Approved, Confidential, or Final. Customize the color and position on any page. Stamp annotations follow the PDF specification and render consistently across viewers. See the stamp annotations guide.

What annotation types does the Java SDK support?

The SDK supports text markup (highlight, underline, strikeout, squiggly), stamps (Draft, Approved, Confidential, Final, Not Approved), shapes (line, circle, square), free text, sticky notes, links (external URLs and internal page navigation), and redaction annotations. See the annotations guide for the full list.

How do I add a highlight annotation with transparency?

Create a highlight annotation on the page’s annotation collection. Then set its color using ARGB values — the alpha channel controls transparency. For example, a semi-transparent yellow highlight uses an alpha value less than 255. See the text markup guide.

How do I add clickable links to a PDF in Java?

Add a link annotation to the page. For external URLs, set the URI destination. For internal navigation, set a page destination with a specific page number and optional x,y coordinates. Link annotations support precise destination positioning within the target page. See the link annotations guide.

How do I add free text to a PDF page in Java?

Add a free text annotation — unlike sticky notes, free text is rendered directly on the page and is always visible. Configure the font family, font size, text color, and background color. Useful for labels, watermarks, and visible comments. See the free text guide.

Can I remove annotations from a PDF in Java?

Yes. Access the page’s annotation collection, iterate through it to find the annotation you want to remove, and delete it by index. You can also iterate all pages and remove annotations in batch.

How do I mark content for redaction in Java?

Add a redaction annotation to mark the area. The content isn’t removed until redaction is applied — this gives you a review step. Set the interior color to opaque black to visually obscure the content in the preview. See the redaction annotations guide.


FREE TRIAL

Ready to get started?

Add PDF annotations and stamps in Java in minutes — no payment information required.