The other issue is, when I the QRGetSize function, for this input it gives me version == 5, but when I use this version, I get the "BarcodeQrEncoderInvalidVersionBarcode" error, so I had to use the value 0 for the generating function. When the input is purely english characters, everything works fine and I can use the version I get from GetSize function.
I attach an output PDF, where I try to generate all three of them using " ť ď ľ ň ě š č ř ž ý á í é ó ú " as the input data.
Code: Select all
if (type == Barcode_Subtype.Barcode_QR)
{
int version = 0;
int size = Imaging.BarcodeQRGetSize(Data, BarcodeQREncodingMode.BarcodeQREncodingModeUndefined, BarcodeQRErrorCorrectionLevel.BarcodeQRErrorCorrectionLevelH, ref version, 4, 4);
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(size, size);
Image_ID = Imaging.CreateGdPictureImageFromBitmap(bitmap);
status = Imaging.BarcodeQRWrite(Image_ID, Data, BarcodeQREncodingMode.BarcodeQREncodingModeUndefined, BarcodeQRErrorCorrectionLevel.BarcodeQRErrorCorrectionLevelH, 0, 4, 4, 0, 0, 0, System.Drawing.Color.Black, System.Drawing.Color.White);
}
else if (type == Barcode_Subtype.Barcode_PDF417)
{
int width = 0;
int height = 0;
int cols = 0;
int rows = 0;
BarcodePDF417ErrorCorrectionLevel corr_level = BarcodePDF417ErrorCorrectionLevel.BarcodePDF417ErrorCorrectionLevelAuto;
status = Imaging.BarcodePDF417GetSize(Data, BarcodePDF417EncodingMode.BarcodePDF417EncodingModeUndefined, ref corr_level, ref rows, ref cols, 4, 4, 15, ref width, ref height);
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(width, height);
Image_ID = Imaging.CreateGdPictureImageFromBitmap(bitmap);
status = Imaging.DrawFilledRectangle(Image_ID, 0, 0, width, height, System.Drawing.Color.White, false);
status = Imaging.BarcodePDF417Write(Image_ID, Data, BarcodePDF417EncodingMode.BarcodePDF417EncodingModeUndefined, corr_level, rows, cols, 4, 4, 15, 0, 0, 0, System.Drawing.Color.Black, System.Drawing.Color.White);
}
else if (type == Barcode_Subtype.Barcode_DataMatrix)
{
BarcodeDataMatrixVersion version = BarcodeDataMatrixVersion.BarcodeDataMatrixVersionAuto;
int width = 0;
int height = 0;
status = Imaging.BarcodeDataMatrixGetSize(Data, BarcodeDataMatrixEncodingMode.BarcodeDataMatrixEncodingModeUndefined, ref version, 4, 4, ref width, ref height);
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(width, height);
Image_ID = Imaging.CreateGdPictureImageFromBitmap(bitmap);
status = Imaging.DrawFilledRectangle(Image_ID, 0, 0, width, height, System.Drawing.Color.White, false);
status = Imaging.BarcodeDataMatrixWrite(Image_ID, Data, BarcodeDataMatrixEncodingMode.BarcodeDataMatrixEncodingModeUndefined, ref version, 4, 4, 0, 0, 0, System.Drawing.Color.Black, System.Drawing.Color.White);
}
Code: Select all
BarCode #1 - Barcode1DReaderEAN13:
8594160390009:
BarCode #2 - PDF417:
This is text in the PDF417:
BarCode #3 - QR Code:
This is text in the QR code:
BarCode #4 - Data Matrix:
This is text in the Data Matrix:
However, the QR code generation is not working, which you can clearly see in the output file.