New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions

Limit Reached Encoding Data Matrix Barcode with many characters

Hi, I'm using the DataMatrix Windows Forms Control (WinForms) to create a barcode by feeding the DataToEncode property. That data seems to get cut, and only the first 1500 characters get encoded. Is there a way to up that limit?
Thanks in advance, Francois


08-12-25     214 day(s) ago    

  Report Abuse

 

Jacque

Best Answer

NOTE: The .NET Forms Control (WinForms) does not have an "Auto" encoding mode. For the newer .NET versions, IDAutomation recommends using the .NET Generator, which includes the auto mode in Data Matrix and QR Code. This auto mode can reduce the symbol size in many situations.

We tested with a larger data set in WinForms and successfully generated a Data Matrix containing 1,500 characters, which scanned without issue. Regarding your code, we noticed a few minor points that could prevent a scannable barcode from being produced. In the updated example below, we ensured that the encoding mode is set correctly, added the missing backslash in the save path, and changed the output location to a user folder to avoid any administrative permission conflicts. With these adjustments, the code ran successfully and produced a scannable barcode. Give it a try and let us know if you have further questions.

Imports IDAutomation.Windows.Forms.DataMatrixBarcode

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim Cb1 As New DataMatrixBarcode()

' Set barcode properties
Cb1.ApplyTilde = False
Cb1.CaptionAbove = ""
Cb1.CaptionBelow = ""
Cb1.CaptionBottomAlignment = System.Drawing.StringAlignment.Center
Cb1.CaptionBottomColor = System.Drawing.Color.Black
Cb1.CaptionBottomSpace = "0.10"
Cb1.CaptionFontAbove = New System.Drawing.Font("Times New Roman", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
Cb1.CaptionFontBelow = New System.Drawing.Font("Times New Roman", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
Cb1.CaptionTopAlignment = System.Drawing.StringAlignment.Center
Cb1.CaptionTopColor = System.Drawing.Color.Black
Cb1.CaptionTopSpace = "0.10"
Cb1.DataToEncode = "IDAutomation.com, Inc."
Cb1.DoPaint = True
Cb1.EncodingMode = EncodingModes.Base256
Cb1.FitControlToBarcode = True
Cb1.LeftMarginCM = "0.000"
Cb1.Location = New System.Drawing.Point(12, 12)
Cb1.Size = New System.Drawing.Size(150, 150)
Cb1.XDimensionCM = "0.185"
Cb1.XDimensionMILS = "73.0000"

' Add control to the form
Me.Controls.Add(Cb1)

' Save barcode as BMP
Dim codbar As System.Drawing.Image = Cb1.Picture
Dim codbmpOri As New System.Drawing.Bitmap(codbar)
codbmpOri.Save("C:UsersAUserDocumentsdocumenttest.bmp", System.Drawing.Imaging.ImageFormat.Bmp)
End Sub

End Class

Posted 213 day(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.
Other Answers (2)

Francois
Thanks for your answer. Since there shouldn't be a problem (let's say I don't mind the oversized image it produces), do you see anything with this code that could cause the issue?

We are using the library IDAutomation.DataMatrix 7.11 (runtime v1.1.4322)

Friend WithEvents Cb1 As IDAutomation.Windows.Forms.DataMatrixBarcode.DataMatrixBarcode

Me.Cb1 = New IDAutomation.Windows.Forms.DataMatrixBarcode.DataMatrixBarcode()

Me.Cb1.ApplyTilde = False
Me.Cb1.CaptionAbove = ""
Me.Cb1.CaptionBelow = ""
Me.Cb1.CaptionBottomAlignment = System.Drawing.StringAlignment.Center
Me.Cb1.CaptionBottomColor = System.Drawing.Color.Black
Me.Cb1.CaptionBottomSpace = "0.10"
Me.Cb1.CaptionFontAbove = New System.Drawing.Font("Times New Roman", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
Me.Cb1.CaptionFontBelow = New System.Drawing.Font("Times New Roman", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
Me.Cb1.CaptionTopAlignment = System.Drawing.StringAlignment.Center
Me.Cb1.CaptionTopColor = System.Drawing.Color.Black
Me.Cb1.CaptionTopSpace = "0.10"
Me.Cb1.DataToEncode = "IDAutomation.com, Inc."
Me.Cb1.DoPaint = True
Me.Cb1.EncodingMode = IDAutomation.Windows.Forms.DataMatrixBarcode.DataMatrixBarcode.EncodingModes.Base256
Me.Cb1.FitControlToBarcode = True
Me.Cb1.LeftMarginCM = "0.000"
Me.Cb1.Location = New System.Drawing.Point(12, 538)
Me.Cb1.Name = "Cb1"
Me.Cb1.OneBitPerPixelImage = False
Me.Cb1.PreferredFormat = IDAutomation.Windows.Forms.DataMatrixBarcode.DataMatrixBarcode.PreferredFormats.[Auto]
Me.Cb1.Resolution = IDAutomation.Windows.Forms.DataMatrixBarcode.DataMatrixBarcode.Resolutions.Printer
Me.Cb1.ResolutionCustomDPI = 600
Me.Cb1.ResolutionPrinterToUse = ""
Me.Cb1.RotationAngle = IDAutomation.Windows.Forms.DataMatrixBarcode.DataMatrixBarcode.RotationAngles.Zero_Degrees
Me.Cb1.Size = New System.Drawing.Size(46, 46)
Me.Cb1.TabIndex = 0
Me.Cb1.TopMarginCM = "0.000"
Me.Cb1.XDimensionCM = "0.185"
Me.Cb1.XDimensionMILS = "73.0000"

Cb1.DataToEncode = RichTextBox1.Text

Dim codbar As System.Drawing.Image = Cb1.Picture

Dim codbmpOri As New System.Drawing.Bitmap(codbar)
Dim codbmpCrop As System.Drawing.Bitmap
codbmpCrop = codbmpOri
codbmpCrop.Save("C:documenttest.bmp", System.Drawing.Imaging.ImageFormat.Bmp)

Posted 213 day(s) ago

(0)
(0)
   Report Abuse

debrac
Hello Francois,

I have had the opportunity to test multiple encoding tools today with more than 1500 characters, and in all cases I have tested, the barcodes are generating with more than 1500 characters without issue. These barcodes are very large, taking up an entire page when generated with a point size that can be scanned, but the results show that there is no upper limit to the number of characters that can be encoded in the barcodes in every encoder I have tested.

Likely, the problem is that your scanning device cannot scan more than 1500 characters, so I would recommend that you check with your scanner manufacturer to see if there is an upper limit to the number of characters that can be scanned.

If you have a specific encoding tool you would like us to check for the ability to add more than 1500 characters, please let us know what that encoder is so that we may perform testing.

Posted 213 day(s) ago

(0)
(0)
   Report Abuse
Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTubeJoin us on LinkedIn Follow us on X