GroupDocs.Annotation for Java 23.4 Release Notes

There is 4 features and 1 bug fixed in this release.

Full list of changes in this release

KeyCategorySummary
ANNOTATIONJAVA-1455FeatureAbility to add font size for Replacement annotation
ANNOTATIONJAVA-1454FeatureAdded roles to user model and Role enum. Added filter for replies by user role
ANNOTATIONJAVA-1456FeatureAbility to add SearchFragmentText annotation
ANNOTATIONJAVA-1457FeatureAbility to change image quality for jpg files
ANNOTATIONJAVA-1353FixAnnotation message isn’t appearing

Major Features

Below is the list of most notable changes in release of GroupDocs.Annotation for Java 23.4:

  • Ability to add font size for Replacement annotation.
  • Added roles to user model and Role enum. Added filter for replies by user role.
  • Ability to add SearchFragmentText annotation.
  • Ability to change image quality for jpg files.

Ability to add font size for Replacement annotation

Now you can add font size for Replacement annotation. For example:

import com.groupdocs.annotation.Annotator;

try (final Annotator annotator = new Annotator(...)) {
	ReplacementAnnotation replacement = new ReplacementAnnotation();
	replacement.setFontSize(8.);
	...
	annotator.add(replacement);
	annotator.save(_resultPath);
}

You can change the font size for replacement annotation.

Added roles to user model and Role enum. Added filter for replies by user role

Now you can set role for Users. For example:

import com.groupdocs.annotation.Annotator;

try (final Annotator annotator = new Annotator(...)) {
	Reply reply1 = new Reply();
    reply1.setComment("This comment will be applied");
    reply1.setRepliedOn(Calendar.getInstance().getTime());
    User user1 = new User(1, "Reviewer", Role.Editor);
    reply1.setUser(user1);

    Reply reply2 = new Reply();
    reply2.setComment("This comment will NOT be applied");
    reply2.setRepliedOn(Calendar.getInstance().getTime());
    User user2 = new User(1, "Member", Role.Viewer);
    reply2.setUser(user2);

    java.util.List<Reply> replies = new ArrayList<>();
    replies.add(reply1);
    replies.add(reply2);

    AreaAnnotation area = new AreaAnnotation();
	...
    area.setReplies(replies);
    annotator.add(area);
    annotator.save(outputPath);
}

You can set user with role for replies. Two available roles - Editor and Viewer.

Ability to add SearchFragmentText annotation

Now you add SearchFragmentText annotation. For example:

import com.groupdocs.annotation.Annotator;

try (final Annotator annotator = new Annotator(...)) {
	SearchTextFragment searchText = new SearchTextFragment();
    searchText.setText("We make document");
    searchText.setFontSize(10.);
    searchText.setFontFamily("Calibri");
    searchText.setFontColor(65535);
    searchText.setBackgroundColor(16761035);
	
    annotator.add(searchText);
    annotator.save(outputPath);
}

You can add SearchFragmentText annotation.

Ability to change image quality for jpg files

Now you change image quality for jpg files. For example:

import com.groupdocs.annotation.Annotator;

try (final Annotator annotator = new Annotator(...)) {
	String dataDir = ...; // specify the path to the input PDF file
	String data = "...\\image.jpg";
	int pageNumber = 1; // set the page where the image will be inserted
	int imageQuality = 10; // set image quality from 1 to 100
	annotator.getDocument().addImageToDocument(dataDir, data, pageNumber, imageQuality);
}

You can change image quality for jpg files (when adding jpg into PDF files).