Skip to content

PDF417Barcode

Namespace: O2S.Components.PDF4NET.Graphics

Defines the base class for PDF 417 family of barcodes.

public abstract class PDF417Barcode : PDF2DBarcode

Inheritance ObjectPDFBarcodePDF2DBarcodePDF417Barcode

Constructors

PDF417Barcode()

Initializes a new PDF417RegularBarcode object.

public PDF417Barcode()

Properties

BackgroundColor

Gets or sets the barcode background color.

public PDFColor BackgroundColor { get; set; }

Property Value

PDFColor
A PDFColor that represents the color used to fill the barcode background.


BarColor

Gets or sets the barcode bar color.

public PDFColor BarColor { get; set; }

Property Value

PDFColor
A PDFColor that represents the color used to draw the barcode bars.


BinaryData

Gets or sets the binary data.

public Byte[] BinaryData { get; set; }

Property Value

Byte[]
An array of bytes representing the data to be encoded.


CompactionMode

Gets or sets the data compaction mode for this barcode.

public PDF417DataCompactionMode CompactionMode { get; set; }

Property Value

PDF417DataCompactionMode
A PDF417DataCompactionMode enumeration member specifying the data compaction mode used in this barcode.

Remarks

The Text compaction mode provides a 2:1 compaction ratio when using only ASCII characters from 0x20 to 0x7F. The Numeric compaction mode provides a 2.93:1 compaction ratio when using only digits (0x30 to 0x39). Byte compaction mode provides a 1.2:1 compaction ratio when using any 8bit character.


Data

Gets or sets the barcode data.

public string Data { get; set; }

Property Value

String
A string of characters that represents the data to be encoded as a barcode.

Remarks

Each barcode type specifies the characters it supports.


Height

Gets the barcode height.

public double Height { get; }

Property Value

Double
The height of the barcode.


IsValid

Gets a value indicating whether a valid barcode can be built.

public bool IsValid { get; }

Property Value

Boolean
True if the barcode can be built, false otherwise.

Remarks

The following items are considered when building the barcode: barcode data, rows, columns and error correction level.


QuietZones

Gets the barcode quiet zones.

public PDFBarcodeQuietZones QuietZones { get; }

Property Value

PDFBarcodeQuietZones
Left, right, top and bottom quiet zones.


TextColor

Gets or sets the barcode text color.

public PDFColor TextColor { get; set; }

Property Value

PDFColor
A PDFColor that represents the color used to display the barcode text.


Width

Gets the barcode width.

public double Width { get; }

Property Value

Double
The width of the barcode.


XDimension

Gets or sets the X dimension.

public double XDimension { get; set; }

Property Value

Double
The width of a narrow barcode bar.


YDimension

Gets or sets the Y dimension.

public double YDimension { get; set; }

Property Value

Double
The height of a barcode bar.


Methods

GetMaxDataLength()

Calculates the length of the maximum data section that can be encoded in the barcode.

public int GetMaxDataLength()

Returns

Int32
The maximum length of encoded data.

Remarks

This method calculates how much of the barcode data can be actually encoded in the barcode. The encoded data is considered to start at the beginning of barcode data. The maximum length is calculated based on barcode data, error correction level and barcode rows and columns.