I have 1 PDF file. I need to fetch key values. I am able to convert PDF to text by using pdfBox and itext api's but text is not in proper format. I need to get the values from the text and have to do some calculation. Below is the piece of code:
PDFTextStripperByArea stripper = new PDFTextStripperByArea();
stripper.setSortByPosition(true);
PDFTextStripper pstripper = new PDFTextStripper();
String text = pstripper.getText(pddoc);
String lines[] = text.split("\\r?\\n");
for (String line : lines) {
System.out.println(line);
}
pddoc.close();
Could you please help me on this? Thanks.