ByteScout BarCode Generator SDK – C# – PDF417 With Binary Data

  • Home
  • /
  • Articles
  • /
  • ByteScout BarCode Generator SDK – C# – PDF417 With Binary Data

ByteScout BarCode Generator SDK – C# – PDF417 With Binary Data

Program.cs

using System.Diagnostics;
using System.Text;
using Bytescout.BarCode;

namespace PDF417WithBinaryData
{
	class Program
	{
		static void Main(string[] args)
		{
			// Create Barcode component instance
			using (Barcode barcode = new Barcode())
			{
				barcode.RegistrationName = "demo";
				barcode.RegistrationKey = "demo";

				// Set barcode type
				barcode.Symbology = SymbologyType.PDF417;
				// Force binary mode
				barcode.Options.PDF417CompactionMode = PDF417CompactionMode.Binary;

				// Sample byte array to use as value  
				byte[] byteArray = new byte[] { 0, 10, 11, 12, 13, 14, 15, 0xFF };

				// Set value by converting byte array to string  
				barcode.Value = Encoding.ASCII.GetString(byteArray);

				// Save barcode image
				barcode.SaveImage("result.png");

				// Open output image in default associated application
				Process.Start("result.png");
			}
		}
	}
}


  Click here to get your Free Trial version of the SDK

prev
next