好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Java在PDF中删除注释

流程

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中删除注释的方法,希望对大家有所帮助。 更多Java学习指路: Java基础

本教程操作环境:windows7系统、java10版,DELL G3电脑。

查看更多关于Java在PDF中删除注释的详细内容...

  阅读:29次