ByteScout Barcode Suite - C# - Print barcode with barcode sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Barcode Suite – C# – Print barcode with barcode sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Suite – C# – Print barcode with barcode sdk

How to print barcode with barcode sdk in C# with ByteScout Barcode Suite

Learn to print barcode with barcode sdk in C#

On this page you will learn from code samples for programming in C#.Writing of the code to print barcode with barcode sdk in C# can be executed by programmers of any level using ByteScout Barcode Suite. ByteScout Barcode Suite can print barcode with barcode sdk. It can be applied from C#. ByteScout Barcode Suite is the set that includes three different SDK products to generate barcodes, read barcodes and read and write spreadsheets: Barcode SDK, Barcode Reader SDK and Spreadsheet SDK.

Want to save time? You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout Barcode Suite for print barcode with barcode sdk below and use it in your application. Simply copy and paste in your C# project or application you and then run your app! If you want to use these C# sample examples in one or many applications then they can be used easily.

You can download free trial version of ByteScout Barcode 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)

BarcodePrinter.cs
      
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); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Program.cs
      
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); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next