Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws IOException
- {
- PdfReader reader = new PdfReader("C:\PDF\test.pdf");
- for (int i = 1; i <= reader.getNumberOfPages(); i++) {
- PdfArray array = reader.getPageN(i).getAsArray(PdfName.ANNOTS);
- if (array == null) continue;
- for (int j = 0; j < array.size(); j++) {
- PdfDictionary annot = array.getAsDict(j);
- if(annot.getAsString(PdfName.CONTENTS)!=null)
- {
- System.out.println(annot.getAsString(PdfName.CONTENTS));
- System.out.println(annot.getAsString(PdfName.T));
- System.out.println(annot.get(PdfName.CREATIONDATE));
- System.out.println(annot.get(PdfName.IRT));
- System.out.println("--------");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment