DrawBarcode
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 TDebenuPDFLibrary1811.DrawBarcode(Left, Top, Width, Height: Double;
Text: WideString; Barcode, Options: Integer): Integer;
ActiveX
Function DebenuPDFLibrary1811.PDFLibrary::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 DPLDrawBarcode(int InstanceID, double Left, double Top, double Width,
double Height, wchar_t * Text, int Barcode, int Options)
Parameters
Left | Horizontal co-ordinate of left edge of the barcode |
Top | Vertical co-ordinate of top edge of the barcode |
Width | Width of the barcode |
Height | Height of the barcode |
Text |
The barcode data. For UPC the string must be 13 digits long with a leading zero. 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 |
Barcode |
1 = Code39 (or Code 3 of 9) 2 = EAN-13 or UPC 3 = Code128 4 = PostNet 5 = Interleaved 2 of 5 |
Options |
Code39: 0 = Default drawing EAN-13 or UPC: 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 4 = Draw as UPC (leading zero is not shown) 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
0 | The barcode could not be drawn. Invalid Barcode or Options parameters. |
1 | The barcode was drawn successfully |