mardi 26 février 2019

How to identify checkboxes in a flat pdf?

Team,

I have to validate a flattened pdf as part of a requirement. This pdf has checkboxes. I used Apache PDFBOX library to read the contents of this PDF. It is only reading the text but not identifying the checkboxes. Please find attached a screenshot of a similar pdf file that i am using Flat PDF with Checkbox :

enter image description here

Can you please provide me any approach to identify and validate these checkboxes

Code Snippet used

        PDFTextStripper stripper = new PDFTextStripper() ;
        PDDocument document = new PDDocument() ;            
        document = PDDocument.load(new File("D:\\test.pdf"));
        stripper.setStartPage(1);
        stripper.setEndPage(1);
        stripper.setSortByPosition(true);
        pdfTextContent = stripper.getText(document);
        System.out.println(pdfTextContent);




Aucun commentaire:

Enregistrer un commentaire