商城首页欢迎来到中国正版软件门户

您的位置:首页 >Java怎么在PDF中删除注释

Java怎么在PDF中删除注释

  发布于2023-05-02 阅读(0)

扫一扫,手机访问

流程

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");
本文转载于:https://www.yisu.com/zixun/696000.html 如有侵犯,请联系zhengruancom@outlook.com删除。
免责声明:正软商城发布此文仅为传递信息,不代表正软商城认同其观点或证实其描述。

热门关注