An easy to understand sample source code to learn how to print barcode with barcode sdk in C# ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can print barcode with barcode sdk in C#.
Want to quickly learn? This fast application programming interfaces of ByteScout Premium Suite for C# plus the guidelines and the code below will help you quickly learn how to print barcode with barcode sdk. Simply copy and paste in your C# project or application you and then run your app! Want to see how it works with your data then code testing will allow the function to be tested and work properly.
You can download free trial version of ByteScout Premium Suite from our website to see and try many others source code samples for C#.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
using System; using System.Collections.Generic; using System.Text; using Bytescout.BarCode; using System.Drawing.Printing; using System.Windows.Forms; using System.Drawing; namespace printBarcodeCSharp2008 { class BarcodePrinter { private Barcode m_barcode = new Barcode(); private float m_widthInches; private float m_heightInches; public void Print(SymbologyType type, string value, string caption, float widthInches, float heightInches) { m_barcode.Symbology = type; m_barcode.Value = value; m_barcode.Caption = caption; m_widthInches = widthInches; m_heightInches = heightInches; PrintDocument printDoc = new PrintDocument(); printDoc.PrintPage += new PrintPageEventHandler(printDoc_PrintPage); PrintDialog dlgSettings = new PrintDialog(); dlgSettings.Document = printDoc; if (dlgSettings.ShowDialog() == DialogResult.OK) { printDoc.Print(); } } void printDoc_PrintPage(object sender, PrintPageEventArgs e) { Point position = new Point(100, 100); m_barcode.FitInto(new SizeF(m_widthInches, m_heightInches), UnitOfMeasure.Inch); m_barcode.Draw(e.Graphics, position); } } }
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
using System; using Bytescout.BarCode; namespace printBarcodeCSharp2008 { class Program { static void Main(string[] args) { BarcodePrinter bPrinter = new BarcodePrinter(); bPrinter.Print(SymbologyType.Code39, "0123456789", "Case Number", 3.5f, 1f); } } }
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: