Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Nov 6, 2017
Jul 26, 2021

GitHub release (latest by date) GitHub all releases GitHub

Java Library for Document Annotation

GroupDocs.Annotation for Java is a Document Annotation API that supports over 13 different annotation types for over 50 document formats with full control over annotation's appearance.

Directory Description
Demos GroupDocs.Annotation for Java Dropwizard and Spring Demo projects.
Examples Java examples and sample documents for you to get started quickly.

Annotate Documents via Java

  • Add, extract, update or remove annotations.
  • Import existing annotations from documents.
  • Add or remove comments.
  • Export annotated documents.
  • Generate document previews & thumbnails.
  • Load password protected documents.
  • Save annotated pages or pages by range.

Annotation Objects

Graphic Annotation: Area, Arrow, Distance, Ellipse, Point, Polyline, Resource Redaction, TextField
Text Annotation: Highlight, Link, Replacement, Strikeout, Reduction, Underline
Watermark: Diagonal, Horizontal

Get Started with GroupDocs.Annotation for Java

GroupDocs.Annotation for Java requires J2SE 7.0 (1.7), J2SE 8.0 (1.8) or above. Please install Java first if you do not have it already.

GroupDocs hosts all Java APIs on GroupDocs Artifact Repository, so simply configure your Maven project to fetch the dependencies automatically.

Add Watermark Annotation

String outputPath = Constants.getOutputFilePath("AddWatermarkAnnotation", FilenameUtils.getExtension(Constants.INPUT));
final Annotator annotator = new Annotator(Constants.INPUT);
try {
	Reply reply1 = new Reply();
	reply1.setComment("First comment");
	reply1.setRepliedOn(Calendar.getInstance().getTime());
	Reply reply2 = new Reply();
	reply2.setComment("Second comment");
	reply2.setRepliedOn(Calendar.getInstance().getTime());
	java.util.List<Reply> replies =  new ArrayList<Reply>();
	replies.add(reply1);
	replies.add(reply2);
	WatermarkAnnotation watermark = new WatermarkAnnotation();
	watermark.setAngle((double) 75);
	watermark.setBox(new Rectangle(200, 200, 100, 50));
	watermark.setCreatedOn(Calendar.getInstance().getTime());
	watermark.setText("Watermark");
	watermark.setFontColor(65535);
	watermark.setFontSize((double) 12);
	watermark.setMessage("This is watermark annotation");
	watermark.setOpacity(0.7);
	watermark.setPageNumber(0);
	watermark.setReplies(replies);
	annotator.add(watermark);
	annotator.save(outputPath);
} finally {
	if (annotator != null) {
		annotator.dispose();
	}
}

Home | Product Page | Documentation | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License