Thanks Sean for the response...We managed the issue by generating
barcode using QRCodeWriter of ZXing.
After that,when it comes to reading the same barcode... we changed our
code from Code128Reader to QRCodeMultiReader..That fixed the
problem...Please check code below.
File pdfFile = new File("C:/scanned/Scan_000177.pdf");
QRCodeMultiReader reader = new QRCodeMultiReader();
Result result=null;
FileInputStream input = new FileInputStream(pdfFile);
PDDocument testDoc = PDDocument.load(input);
List<PDPage> pages =
testDoc.getDocumentCatalog().getAllPages();
for(int i=0; i<pages.size(); i++) {
PDPage page = (PDPage)pages.get(i);
BufferedImage image = page.convertToImage();
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new
GlobalHistogramBinarizer(source));
result = reader.decode(bitmap);
}
System.out.println(result.getText());
Output is successfully printed in our console.
Currently this code is working fine for us, but i want to understand
why it didn't work for Code128Writer and Code128Reader(As posted in my
previous email above)
The data we try to encode in barcode is, 8135:Progress Notes:
03/05/2012