DrawBarcode

Vector graphics, Barcodes

Description

Draws a barcode on the selected page.

For Code128, the barcode is a combination of the "B" and "C" character sets resulting in the most compact representation.

GS1-128 barcodes (also known as EAN-128) can be drawn by setting the Barcode parameter to 3 (Code128) and using the string "[FNC1]" in the appropriate place. For example:

"[FNC1]21ABC123[FNC1]2013"

The previous example indicates a serial number (AI 21) of "ABC123" and a product variant (AI 20) of "13".

Syntax

Delphi

function TPDFlib.DrawBarcode(Left, Top, Width, Height: Double; Const Text: WideString; Barcode, Options: Integer): Integer;

ActiveX

Function PDFlib::DrawBarcode(Left As Double, Top As Double, Width As Double, Height As Double, Text As String, Barcode As Long, Options As Long) As Long

DLL

int DLDrawBarcode(int InstanceID, double Left, double Top, double Width, double Height, wchar_t * Text, int Barcode, int Options);

Parameters

LeftHorizontal co-ordinate of left edge of the barcode
TopVertical co-ordinate of top edge of the barcode
WidthWidth of the barcode Height of the barcode
Height
TextThe barcode data. The barcode can be rotated by appending the following to the barcode data string: /RC = Rotate clockwise /RA = Rotate anti-clockwise /RU = Rotate 180 degrees
Barcode1 = Code39 (or Code 3 of 9) 2 = EAN-13 3 = Code128 4 = PostNet 5 = Interleaved 2 of 5
OptionsCode39: 0 = Default drawing EAN-13: 0 = Only draw the barcode 1 = Extend the guard bars 2 = Draw the human-readable numbers 3 = Draw the human-readable numbers, with right spacer Code128: 0 = Default drawing PostNet: 0 = Default drawing Interleaved 2 of 5: 0 = Do not add a checksum, no bearer bars 1 = Add a checksum character, no bearer bars 2 = Do not add a checksum, draw bearer bars 3 = Add a checksum character, draw bearer bars To apply 10% bar width reduction to the barcode, increase the value of the Options parameter by 10

Return values

0The barcode could not be drawn. Invalid Barcode or Options parameters.
1The barcode was drawn successfully