The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
HAhaneefm 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
HAhaneefm 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; } }