PowerBuilder 2022
I am working on a project where I am using EZTwain to scan documents, look for a barcode to get the routing information, save them as a PDF, then send them to the database as a blob. I now need to support reading a QR code which EZTwain does not automatically support. I have been looking at using the ZXing library to look for the barcode or QR code but I think the call to do it requires a bitmap image from the DIB. This example code is really what I need to do in PB:
==========
// Get the image data as a Bitmap
Bitmap bmp = twain.GetImage(0);
// Decode the QR code using ZXing
BarcodeReader reader = new BarcodeReader();
reader.Options = new DecodingOptions
{
PossibleFormats = new List<BarcodeFormat> { BarcodeFormat.QR_CODE }
};
Result result = reader.Decode(bmp);
===========
I have been reading a lot about other developers trying to print a QR code (which I will need to do too) but nothing about trying to consume it. EZTwain has a way to convert the DIB to a DIBSection which is a 'special kind of HBITMAP' but I have not been able to figure out if I can use that to pass to ZXing.
Anyway, if anyone has thoughts on this please chime in! I feel like I am spinning in circles so someone needs to knock me off my path a little.
Chris Craft
https://simplesolution.dev/java-read-qr-code-from-image-file-base64-zxing/#:~:text=In%20this%20step%20we%20implement%20a%20QRCodeReader%20class,argument%20and%20returns%20encoded%20text%20in%20QR%20Code.
I'm traveling, so I won't be able to try and help you out for a couple of days. Maybe if the weather isn't that great I can make some time :)