Java在PDF中如何删除注释

WBOY
WBOY转载
2023-04-28 12:04:06840浏览

流程

1、使用Document类加载PDF文档。

2、用Document.getPages().get_Item(int).getAnnotations().delete()删除所有注释。

3、用Document.save保存更新的PDF。

实例

// Open source PDF document
Document pdfDocument = new Document("input.pdf");
 
// Delete all annotation
pdfDocument.getPages().get_Item(1).getAnnotations().delete();
 
// Save the update document
pdfDocument.save("output.pdf");

以上就是Java在PDF中如何删除注释的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:亿速云,如有侵犯,请联系admin@php.cn删除