Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am able to generate and display the barcode but unable to print the barcode.

What I have tried:

PrintDocument document = new PrintDocument();
                   BarcodeDraw bdraw = BarcodeDrawFactory.GetSymbology(BarcodeSymbology.Code128);
                   System.Drawing.Image barcodeImage = bdraw.Draw("ABCVGHFTHJY", 50);

                   document.PrintPage += delegate (object sender, PrintPageEventArgs e)
                   {
                       e.Graphics.DrawImage(barcodeImage, 0, 0);
                       e.Graphics.DrawString("ABCVGHFTHJY", new Font("arial", 8), new SolidBrush(Color.Black), 0, 50);
                   };
                   document.Print();
Posted
Comments
Richard Deeming 25-Jul-18 9:48am    
Your code is running on the server.

Even if you managed to get it to work, it would print out on the printer connected to the server.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900