PDF417 .NET Standard & .NET Core Barcode Generator Code Examples

Buy License Download Demo Support

PDF417 .NET Standard in Xamarin

.NET Standard 2.0 Integration

The following code is provided to assist with implementation. Please refer to the Barcode Generation and Xamarin examples provided in the download package for actual working app examples. The included .NET Standard 2.0 source code and assembly supports .NET Core 2.0, .NET Framework, Mono, Xamarin, Unity, and Universal Windows Platform.

Availability:

  • This product is sold as a separate component that primarily generates images and does not require the use of barcode fonts, however, basic barcode fonts are provided.
  • This product is also included as a font encoder in all Developer License Packages of the PDF417 Font and Encoder

Generate text for IDAutomation2D font or Unicode Image on a label

C# Code Example:
PDF417 obj = new PDF417();
Label lblBarcode = new Label();
(if you want to use the IDAutomation2D font)
string textfont = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, OutputTypes.IDA2DFont);
lblBarcode.Font = new System.Drawing.Font("IDAutomation2D", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
or (if you want to use Courier New as Unicode Image)
string textfont = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, OutputTypes.IDAMonospaceFont);
lblBarcode.Font = new System.Drawing.Font("Courier New", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
lblBarcode.Text = textfont;
VB.NET Code Example: 
Dim obj As New PDF417()
Dim lblBarcode as Label = new Label()
(if you want to use the IDAutomation2D font)
Dim textfont as string = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, OutputTypes.IDA2DFont)
lblBarcode.Font = new System.Drawing.Font("IDAutomation2D", 8.25, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0)
or (if you want to use Courier New as Unicode Image)
Dim textfont as string = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, OutputTypes.IDAMonospaceFont)
lblBarcode.Font = new System.Drawing.Font("Courier New", 6, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0)
lblBarcode.Text = textfont

Generate SVG or the HTML output on a web browser control

C# Code Example:
PDF417 obj = new PDF417();
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecSVG, "", QuietZone, ModuleSize);
or
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecHTML, "", QuietZone, ModuleSize);
WebBrowser webBrowser = new WebBrowser();
webBrowser.DocumentText = vectorimage;
VB.NET Code Example: 
Dim obj As New PDF417()
Dim vectorimage as string = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecSVG, "", QuietZone, ModuleSize)
or
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecHTML, "", QuietZone, ModuleSize)
Dim webBrowser as WebBrowser = new WebBrowser()
webBrowser.DocumentText = vectorimage

Generate SVG, EPS or the HTML output to save as a file

C# Code Example:
PDF417 obj = new PDF417();
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecSVG, "", QuietZone, ModuleSize);
File.WriteAllText("PDF417.SVG", vectorimage);
or
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecEPS, "", QuietZone, ModuleSize);
File.WriteAllText("PDF417.EPS", vectorimage);
or
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecHTML, "", QuietZone, ModuleSize);
File.WriteAllText("PDF417.HTML", vectorimage);
VB.NET Code Example: 
Dim obj As New PDF417()
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecSVG, "", QuietZone, ModuleSize)
File.WriteAllText("PDF417.SVG", vectorimage)
or
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecEPS, "", QuietZone, ModuleSize)
File.WriteAllText("PDF417.EPS", vectorimage)
or
string vectorimage = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, VectorTypes.VecHTML, "", QuietZone, ModuleSize)
File.WriteAllText("PDF417.HTML", vectorimage)

Generate BMP Image as byte array | output on a picture box control 

C# Code Example:
PDF417 obj = new PDF417();
byte[] bmpstream = obj.EncodePDF417(ddataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, QuietZone, ModuleSize);
PictureBox picImage = new PictureBox();
picImage.AutoSize = true;
using (MemoryStream mStream = new MemoryStream(bmpstream))
{
Image img1 = Image.FromStream(mStream);
picImage.Image = img1;
}
VB.NET Code Example: 
Dim obj As New PDF417()
Dim bmpstream() as Byte = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, QuietZone, ModuleSize)
Dim picImage as PictureBox = new PictureBox()
picImage.AutoSize = true
Dim mStream As MemoryStream = New MemoryStream(bmpstream)
Dim img1 As Image = Image.FromStream(mStream)
picImage.Image = img1

BMP output to save as file

C# Code Example:
C# Code Example
PDF417 obj = new PDF417();
byte[] bmpstream = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, QuietZone, ModuleSize);
File.WriteAllBytes("PDF417.BMP", bmpstream);
VB.NET Code Example: 
Dim obj As New PDF417()
Dim bmpstream() as Byte = obj.EncodePDF417(dataToEncode, applyTilde, eccLevel, encodingMode, NumColumns, NumRows, Truncate, QuietZone, ModuleSize)
File.WriteAllBytes("PDF417.BMP", bmpstream)

Common Parameters

  • DataToEncode - The data that is encoded in the barcode.
  • OutType – (only for font output) Indicates the type of encoded text output for the barcode font (IDAutomation font or Unicode Monospace font).
  • VectorType – (only for vector output) Indicates the type of vector image for output encoded text (SVG, EPS or HTML).
  • ApplyTilde - Enables processing of the tilde for purposes of encoding ASCII functions. For example, ~009 encodes ASCII 9, the tab function.
  • EccLevel - The level of error correction used to create the barcode.
  • EncodingMode - Various modes used to Data represented in the symbol may be encoded by one of these types: Binary or Text).
  • NumColumns - The number of columns in the PDF417 barcode.
  • NumRows - The number of rows in the PDF417 barcode.
  • Truncate - The right hand side of the PDF417 Is removed Or truncated.
  • QuietZone - Defines the size of a blank zone around the code.
  • ModuleSize - Defines the size of each module in pixels. The ModuleSize parameter can control the size of BMP images, however, a multiplicative factor is added to avoid a strange "blur" effect that occurs with low values with SVG and HTML images.

Support

Free product support may be obtained by reviewing the knowledgebase articles that are documented below and by searching the resolved public forum threads. Priority phone, email and forum support is provided up to 30 days after purchase. Additional priority phone, email and forum support may be obtained if the Priority Support and Upgrade Subscription is active.