ZXing.Net
ZXing.Net copied to clipboard
[bug] Unable to read pdf417 barcode in vba
I found a bug, when I use the following vba code to generate pdf417 barcode, after decoding it is empty, why?
Sub test()
Dim myWriter As New BarcodeWriter, myOptions As New PDF417EncodingOptions, myReader As New BarcodeReader, myPath As String
Set myWriter.Options = myOptions
With myOptions
.AspectRatio = PDF417AspectRatio_A1
.ErrorCorrection = PDF417ErrorCorrectionLevel_L3
.Margin = 2
End With
myWriter.Format = BarcodeFormat_PDF_417
myPath = "C:\test1.png"
myWriter.WriteToFile "test", myPath, ImageFileFormat_Png
myReader.Options.PossibleFormats.Add BarcodeFormat_PDF_417
MsgBox myReader.DecodeImageFile(myPath).Text
End Sub
When I set AspectRatio to PDF417AspectRatio_A4, it can be read successfully.
Here are the two generated images:
Is there a solution to this problem? @micjahn
Only not to use A1 at the moment. I hadn't the time to look deeper into the code.