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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Barcode not printing

Thread ID:





124890 Jul 6,2016 02:01 PM UTC Jul 8,2016 05:19 AM UTC WinForms 3
Tags: SfBarcode
Cernat Catalin
Asked On July 6, 2016 02:01 PM UTC


I have this code:

Private Sub BuildCode()
    Dim barcode As String = TextBox1.Text + "%" + TextBox2.Text + "&" + TextBox6.Text + "*"
    'TextBox3.Text = barcode
    SfBarcode1.Text = barcode
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    BMP = New Bitmap(GroupBox1.Width, GroupBox1.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
    'BMP.SetResolution(300, 300)
    GroupBox1.DrawToBitmap(BMP, New Rectangle(0, 0, GroupBox1.Width, GroupBox1.Height))
    Dim pd As New PrintDocument
    Dim pdialog As New PrintDialog
    AddHandler pd.PrintPage, (Sub(s, args)
                                  args.Graphics.DrawImage(BMP, 0, 0)
                                  args.HasMorePages = False
                              End Sub)
    pd.PrinterSettings.PrinterName = pdialog.PrinterSettings.PrinterName
End Sub

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
End Sub

When I assing value to syncfusion barcode control, it builds fine, it shows the barcode on form, but when I print instead of barcode is nothing. If i assign the value to a textbox control with a Code128 font it prints just fine. 

What could it be?

Chinnu Muniyappan [Syncfusion]
Replied On July 7, 2016 12:24 PM UTC

Hi Cernat, 

Thank you for contacting Syncfusion support. 

We have created a workaround sample for exporting the barcode as image and inserting the image to the group box and print the group box control for your reference, please refer the below code snippet and sample for more details. 

       'initialize the barcode control 
        Dim barcode As SfBarcode = New SfBarcode() 
        'set the barcode symbology type 
        barcode.Symbology = BarcodeSymbolType.Code128A 
        'set the input text 
        barcode.Text = TextBox1.Text 
        'export the barcode control as image 
        PictureBox1.Image = barcode.ToImage(PictureBox1.Size) 
Sample link: 

Could you please try this and let us know whether this meet your actual requirement. 


Cernat Catalin
Replied On July 7, 2016 12:44 PM UTC

Thanks alot for your kind reply, but ToImage is not a member of SfBarcode, the compiler says.

What could be wrong?

Chinnu Muniyappan [Syncfusion]
Replied On July 8, 2016 05:19 AM UTC

Hi Cernat, 

Thank you for your update. 

The barcode to image conversion support is available in our latest versions ( only, could you please update to our latest versions and get this support. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon