We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridPrintDocument : Barcode Reading problem

Hi All,

I have following problem :

I need to print a list of barcodes using gridcontrol.
I use the font 3 of 9.
The problem is that when printing, all fonts inside cells are printed slightly smaller than then they should use to be.
Thus my barcodes are printed smaller and can not be read by the device. Increasing fontsize does't help. It seems that trough printing the font gets changed and de barcode gets unreadable.

Printing the barcode in the PrintPage event,
works fine.
e.Graphics.DrawString("*7622200161942*", new Font("3 of 9 Barcode", 18f), new SolidBrush(Color.Black), new PointF(50, 50));

The barcode printed in the 'PrintPage event' are ok and readable. The barcodes in gridcells are slightly smaller (same font,size,..) and won'twork


Any suggestions ?

thx
Gert

2 Replies

HA haneefm Syncfusion Team May 3, 2007 06:26 PM UTC

Hi Gert,

Thank you for your update.

Is it possible for you to upload us a minimal sample to reproduce the issue here? This will help us to analyse the issue further.

Best regards,
Haneef


HA haneefm Syncfusion Team May 3, 2007 10:36 PM UTC

Hi Gert,

One way you can do this by handling the DrawCellDisplayText event and use e.Graphics.DrawString method to draw barcode in a grid cell. Please try the below code and let me know if this helps.

void gridControl1_DrawCellDisplayText(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs e)
{
GridControl grid = sender as GridControl;
if (grid.PrintingMode)
{
e.Graphics.DrawString(e.DisplayText, new Font("3 of 9 Barcode", 18f), new SolidBrush(Color.Black), e.TextRectangle.Location);
e.Cancel = true;
}
}

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon