Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Unable to read pdf417 barcode in vba #433

Open
ghost opened this issue Jul 9, 2022 · 2 comments
Open

[bug] Unable to read pdf417 barcode in vba #433

ghost opened this issue Jul 9, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 9, 2022

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.

test111

Here are the two generated images:
test1
test2

@ghost
Copy link
Author

ghost commented Oct 13, 2022

Is there a solution to this problem?
@micjahn

@micjahn
Copy link
Owner

micjahn commented Oct 14, 2022

Only not to use A1 at the moment. I hadn't the time to look deeper into the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant