GroupDocs.Annotation for Java 让批注 XLSX 电子表格变得轻松:
- 使用 Annotator 实例打开 XLSX。
- 创建并配置所需的批注。
- 将批注添加到电子表格中。
- 保存已批注的 XLSX。
GroupDocs.Annotation for Java 让批注 XLSX 电子表格变得轻松:
// 批注 XLSX 电子表格
// 使用 Annotator 实例打开 XLSX
Annotator annotator = new Annotator("input.xlsx");
try {
// 创建区域批注
AreaAnnotation area = new AreaAnnotation();
area.setBox(new Rectangle(100, 100, 200, 80));
area.setBackgroundColor(65535);
area.setPageNumber(0);
area.setMessage("Important");
// 添加批注
annotator.add(area);
// 保存已注释的 XLSX
annotator.save("annotated.xlsx");
} finally {
annotator.dispose();
}
向 Excel 电子表格添加所有注释类型,并使用简洁的 API 进行管理。

在 XLSX 文件中高亮、下划线、删除线或替换文本。
在 XLSX 工作表上绘制形状并添加水印或图像。
获取、删除、导入和导出 XLSX 注释。
// 打开已注释的 XLSX
Annotator annotator = new Annotator("annotated.xlsx");
try {
// 获取所有注释
List<AnnotationBase> annotations = annotator.get();
// 检查每个注释
for (AnnotationBase annotation : annotations) {
System.out.println(annotation.getMessage());
}
// 保存电子表格
annotator.save("output.xlsx");
} finally {
annotator.dispose();
}