I’m having unpredictable errors generating datamatrix barcodes in .NET.
About 10% of the time, I get the error. The error appears to be randome, and depends on the characters in the Guid.
Aspose.BarCode.InvalidCodeException: The codetext is too big. Max available length - 32 for this barcode size.
My codes are all similar. They are all the same size - 39 characters long.
Constant prefix ‘em1:’ (4 chars) + Guid (32 chars) + and page number ‘001’ (3 char).
This one FAILS - CodeText: ‘em1:a9db1d6e129c460f8cb0efd3927d5d70001’, length: 39
This one SUCCEEDS - CodeText: ‘em1:f331409d6fce405a99ab778bc6c63dff001’, length: 39
The attached file, from the datamatrix example shows the problem.
Question 1 - Why does one string succeed, but another sting of the same length fail?
Question 2 - Why does the error say the max length is 32 when it usually succeeds with the 39 character string?
Question 3 - How do I fix this? I must match the output from an older barcode system based on iTextSharp. The older system has NO PROBLEM generating these barcodes.
CreateDatamatrixBarcode.zip (1.1 KB)