将文档1中的书签转存到文档2:
1 | PdfReader reader1 = new PdfReader("in1.pdf"); |
导出书签文件:
1 | PdfReader reader = new PdfReader("in.pdf"); |
将文档1中的标注(包括超链接)转存到文档2:
1 | PdfReader reader1 = new PdfReader("in1.pdf"); |
如果仅仅读取全部链接,只需将上述代码18行开始的for循环修改为:
1 | for (int j = 0; annotArray != null && j < annotArray.size(); ++j) { |
参考资料:
- iText 5 examples - iText 5 actions and annotations http://developers.itextpdf.com/content/itext-5-examples
- iText in Action, 2nd 2010, 7. Making documents interactive https://www.manning.com/books/itext-in-action-second-edition