I am having a pdf with barcodes. As shown in the image
I am stuck on an issue and not able to proceed with my project. I am using PDFBox for parsing of the PDF and able to convert the whole pdf in the text format as shown in the code below:
public static PdfValues readPdf() throws IOException {
System.out.println("Main Method Started");
File file = new File("D:/po/temp/output.pdf");
PDDocument document = PDDocument.load(file);
PDFTextStripper pdfStripper = new PDFTextStripper();
String text = pdfStripper.getText(document);
text = text.trim();
text = text.replaceAll(" +", " ");
text = text.replaceAll("(?m)^[ \t]*\r?\n", "");
// System.out.println(text);
deleteIfExist();
writeToFile(text);
PdfValues infos = readData();
document.close();
System.out.println("Main Method Ended");
return infos;
}
But I am not getting the barcode value which means it is not a text. Can anyone help me how to parse this barcode values as an image or actual value? Thank you for reading this question.