Table of Contents

Class Barcode

Namespace
PDFjet.NET
Assembly
PDFjet.dll

Used to create one dimensional barcodes - EAN-13, UPC-A, Code 39 and Code 128.

The text of an ITF-14 barcode is the 13 digits of a GTIN without its check digit, which is added, as for UPC-A and EAN-13.

Please see Example_36.

public class Barcode : IDrawable
Inheritance
Barcode
Implements
Inherited Members

Constructors

Barcode(int, string)

The constructor.

public Barcode(int barcodeType, string text)

Parameters

barcodeType int

the type of the barcode.

text string

the content string of the barcode.

Fields

CODE_128

Specifies CODE128 barcode

public static readonly int CODE_128

Field Value

int

CODE_39

Specifies CODE39 barcode

public static readonly int CODE_39

Field Value

int

EAN_13

Specifies EAN13 barcode

public static readonly int EAN_13

Field Value

int

GS1_128

Specifies GS1-128 barcode. Its text is GS1 data written as people read it, each Application Identifier in parentheses and its data after it, such as "(01)09506000134352(10)ABC123", and is drawn so under its bars.

public static readonly int GS1_128

Field Value

int

ITF_14

Specifies ITF-14 barcode. Its text is the 13 digits of a GTIN without its check digit, which is added, as for UPC-A and EAN-13.

public static readonly int ITF_14

Field Value

int

UPC_A

Specifies UPC barcode

public static readonly int UPC_A

Field Value

int

Methods

DrawOn(Page)

Draws this barcode on the specified page.

public float[] DrawOn(Page page)

Parameters

page Page

the page to draw on.

Returns

float[]

x and y coordinates of the bottom right corner of this component.

GetHeight()

Returns the height of this barcode as it is drawn: from its location to the bottom of the bars, or of the text under them, in the direction the barcode is drawn, so a barcode drawn top to bottom or bottom to top is as tall as it is long.

public float GetHeight()

Returns

float

the height of this barcode.

SetAltDescription(string)

Sets what the barcode says, such as its digits, for a screen reader: a tagged document, PDF/UA or a PDF/A of level A, then has the barcode as one figure of that description. Without one, its bars are decoration, which a screen reader skips, and the text under them, if any, is read as text.

public Barcode SetAltDescription(string altDescription)

Parameters

altDescription string

the description.

Returns

Barcode

this Barcode object.

SetBarHeightFactor(float)

Sets the bar height factor. The height of the bars is the moduleLength * barHeightFactor The default value is 50.0

public Barcode SetBarHeightFactor(float barHeightFactor)

Parameters

barHeightFactor float

the specified bar height factor.

Returns

Barcode

this Barcode object.

SetDirection(Direction)

Sets the direction in which this barcode is drawn.

public Barcode SetDirection(Direction direction)

Parameters

direction Direction

the specified direction.

Returns

Barcode

this Barcode object.

SetFont(Font)

Sets the font to be used with this barcode.

public Barcode SetFont(Font font)

Parameters

font Font

the specified font.

Returns

Barcode

this Barcode object.

SetLocation(float, float)

Sets the location where this barcode will be drawn on the page.

public Barcode SetLocation(float x1, float y1)

Parameters

x1 float

the x coordinate of the top left corner of the barcode.

y1 float

the y coordinate of the top left corner of the barcode.

Returns

Barcode

SetModuleLength(float)

Sets the module length of this barcode. The default value is 0.75f

public Barcode SetModuleLength(float moduleLength)

Parameters

moduleLength float

the specified module length.

Returns

Barcode

this Barcode object.