Hello. I have such task: need to create barcode which represent my code string. This string i receive in such way: Guid.NewGuid().ToString(“N”). Here is my code for creating and setting barcode image :
Thank you for inquiry.
The length of GUID string is large and the generated barcode cannot fit in 38 x 6 mm image. Could you please try the following alternates?
- Set auto size to true, so that the image size is always suitable for the barcode.
- The minimum width in which I was able to generated a barcode with xDimension=0.5 was 150mm.
Yes, you are right, but 1D barcode size highly depends on the length of the codetext. In your example link, the image contains “CODE 39” data, which is very small size.
However, the size of GUID string is comparatively larger, e.g. I had “141D835F920D436DB010734034C7A704” generated at my end. This would result in larger barcode image (150 mm) with Code39Standard.
With Code128, the size was reduced to 100mm. Can you accommodate barcode image of this size?
A much better solution would be to use 2D barcodes like Pdf417, Datamatrix or others. A datamatrix barcode with codetext “141D835F920D436DB010734034C7A704” would easily fit in 15 x 15 mm. I would recommend in case your scanner can read 2D barcodes.