<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-annotation</artifactId>
<version>23.8</version>
</dependency>
compile(group: 'com.groupdocs', name: 'groupdocs-annotation', version: '23.8')
<dependency org="com.groupdocs" name="groupdocs-annotation" rev="23.8">
<artifact name="groupdocs-annotation" ext="jar"/>
</dependency>
libraryDependencies += "com.groupdocs" % "groupdocs-annotation" % "23.8"
What’s new in the GroupDocs.Annotation for Java 23.8
Overview
The 23.8 release of GroupDocs.Annotation for Java brings a valuable new feature along with crucial bug fixes. This update enhances the usability and interactivity of your documents and ensures that the documentation and API references are up-to-date.
Major Features
Add Component to Document
- Button Component: Interactive buttons can now be embedded within your documents, enhancing user interaction.
- Dropdown Component: Create dropdown lists for better data collection and user customization.
- Checkbox Component: Introduce checkboxes for task tracking or conditional interactions within documents.
Fixes
- Squiggly Annotation Documentation: The missing squiggly annotation article has been restored in the documentation, providing users with detailed guidance on its usage.
- API References Updated: All API references have been actualized to ensure users have access to the latest information.
Code Samples
Adding a Button Component
The following code snippet demonstrates how to add a button component to a PDF document. The button can be customized with various properties like position, border style, color, and even include comments.
try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) {
// Instantiate a ButtonComponent and set its properties
ButtonComponent buttonComponent = new ButtonComponent();
buttonComponent.setCreatedOn(new Date()); // Set the creation date
buttonComponent.setStyle(BorderStyle.DASHED); // Set border style to dashed
buttonComponent.setMessage("This is button component"); // Set the button's label text
buttonComponent.setBorderColor(1422623); // Set the border color
buttonComponent.setPenColor(14527697); // Set the pen (frame) color
buttonComponent.setButtonColor(10832612); // Set the button's fill color
buttonComponent.setPageNumber(0); // Specify the page number where the button will be placed
buttonComponent.setBorderWidth(12); // Set the width of the button border
buttonComponent.setBox(new Rectangle(100, 300, 90, 30)); // Set the position and size of the button
// Add comments (replies) to the button
Reply reply1 = new Reply();
reply1.setComment("First comment");
reply1.setRepliedOn(new Date());
Reply reply2 = new Reply();
reply2.setComment("Second comment");
reply2.setRepliedOn(new Date());
List<Reply> replies = new ArrayList<>();
replies.add(reply1);
replies.add(reply2);
buttonComponent.setReplies(replies); // Attach the replies to the button
// Add the button component to the document
annotator.add(buttonComponent);
// Save the modified document with the button component
annotator.save("result_button_component.pdf");
}
Adding a Checkbox Component
This code snippet shows how to add a checkbox component to a PDF document. The checkbox can be customized with properties such as whether it is checked, its color, and style.
try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) {
// Instantiate a CheckBoxComponent and set its properties
CheckBoxComponent checkbox = new CheckBoxComponent();
checkbox.setChecked(true); // Set the checkbox as checked
checkbox.setBox(new Rectangle(100, 100, 100, 100)); // Set the position and size of the checkbox
checkbox.setPenColor(65535); // Set the pen (frame) color
checkbox.setStyle(BoxStyle.STAR); // Set the checkbox style (e.g., star-shaped)
// Add comments (replies) to the checkbox
Reply reply1 = new Reply();
reply1.setComment("First comment");
reply1.setRepliedOn(new Date());
Reply reply2 = new Reply();
reply2.setComment("Second comment");
reply2.setRepliedOn(new Date());
List<Reply> replies = new ArrayList<>();
replies.add(reply1);
replies.add(reply2);
checkbox.setReplies(replies); // Attach the replies to the checkbox
// Add the checkbox component to the document
annotator.add(checkbox);
// Save the modified document with the checkbox component
annotator.save("result_checkbox_component.pdf");
}
Adding a Dropdown Component
The following code demonstrates how to add a dropdown (combo box) component to a PDF document. This component can hold a list of selectable options, and its appearance can be customized with properties like border style and color.
try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) {
// Instantiate a DropdownComponent and set its properties
DropdownComponent dropdownComponent = new DropdownComponent();
dropdownComponent.setOptions(new ArrayList<>(Arrays.asList("Item1", "Item2", "Item3"))); // Set dropdown options
dropdownComponent.setSelectedOption(null); // No option selected by default
dropdownComponent.setPlaceholder("Choose option"); // Set placeholder text
dropdownComponent.setBox(new Rectangle(100, 100, 100, 100)); // Set the position and size of the dropdown
dropdownComponent.setCreatedOn(new Date()); // Set the creation date
dropdownComponent.setMessage("This is dropdown component"); // Set the dropdown's label text
dropdownComponent.setPageNumber(0); // Specify the page number
dropdownComponent.setPenColor(65535); // Set the pen (frame) color
dropdownComponent.setPenStyle(PenStyle.DOT); // Set the frame line style (dotted)
dropdownComponent.setPenWidth((byte) 3); // Set the frame line width in pixels
// Add comments (replies) to the dropdown
List<Reply> replies = new ArrayList<>();
Reply reply1 = new Reply();
reply1.setComment("First comment");
reply1.setRepliedOn(new Date());
Reply reply2 = new Reply();
reply2.setComment("Second comment");
reply2.setRepliedOn(new Date());
replies.add(reply1);
replies.add(reply2);
dropdownComponent.setReplies(replies); // Attach the replies to the dropdown
// Add the dropdown component to the document
annotator.add(dropdownComponent);
// Save the modified document with the dropdown component
annotator.save("result_dropdown_component.pdf");
}
🔍 Explore the Full Release Details
To view the complete list of all new features, enhancements, and bug fixes introduced in this release, please visit the GroupDocs.Annotation for Java 23.8 Release Notes.
Version | Release Date |
---|---|
24.6 | June 30, 2024 |
23.10 | October 9, 2023 |
23.8 | August 28, 2023 |
23.6 | June 23, 2023 |
23.4 | April 17, 2023 |
23.2 | April 16, 2023 |
21.7.2 | January 25, 2022 |
21.7.1 | January 25, 2022 |
2.0.0 | January 25, 2022 |
19.2 | January 25, 2022 |
17.10 | January 25, 2022 |
17.10.3 | January 25, 2022 |
1.5.0 | January 25, 2022 |
21.7 | July 21, 2021 |
19.7 | February 19, 2020 |
20.2 | February 13, 2020 |
19.5 | May 30, 2019 |
19.4 | April 15, 2019 |
18.1 | October 16, 2018 |
18.10 | October 16, 2018 |
1.4.0 | April 18, 2018 |
1.6.0 | April 18, 2018 |
1.7.0 | April 18, 2018 |
1.7.1 | April 18, 2018 |
1.8.0 | April 18, 2018 |
1.8.1 | April 18, 2018 |
1.8.2 | April 18, 2018 |
1.9.0 | April 18, 2018 |
17.1.0 | April 18, 2018 |
17.10.1 | April 18, 2018 |
17.10.2 | April 18, 2018 |
17.5.0 | April 18, 2018 |
17.6.0 | April 18, 2018 |
18.4 | April 18, 2018 |
3.1.0 | April 18, 2018 |
File | Classifier | Size |
---|---|---|
groupdocs-annotation-23.8-javadoc.jar | javadoc | 616 KB |
groupdocs-annotation-23.8.jar | 218 MB | |
groupdocs-annotation-23.8.pom | 3 KB |
GroupDocs.Annotation Java API Document Annotation Watermarking Document Management PDF Annotation Word Annotation Excel Annotation PowerPoint Annotation Image Annotation OLE Support Metadata Management Cross-platform Compatibility Text Annotations Area Annotations Markup Annotations Distance Measurement Redaction Custom Annotation Appearance Collaborative Document Review Document Security Metadata Preservation Batch Processing High Performance Scalability Cross-platform Printing Annotations Microsoft Word Microsoft Excel Microsoft PowerPoint PDF JPG PNG BMP DWG DXF Visio Adobe Portable Document Format HyperText Markup Language E-mail Message Annotation Tools Java Maven API Integration On-premise API Document Comparison Document Integrity