- Christopher Craft
- PowerBuilder
- Sunday, 16 April 2023 05:45 PM UTC
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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.