DrawBarcode

矢量图形、条码

描述

在选定页面上绘制条码

对于 Code128,条形码由 "B" 和 "C" 字符集组合而成,从而获得最紧凑的表示

将 Barcode 参数设为 3(Code128),并在适当位置使用字符串 "[FNC1]",即可绘制 GS1-128 条形码(也称为 EAN-128),例如:

"[FNC1]21ABC123[FNC1]2013"

前述示例表示序列号(AI 21)为 "ABC123",产品变体(AI 20)为 "13"

语法

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, const wchar_t * Text, int Barcode, int Options);

参数

Left条码左边缘的水平坐标
Top条形码顶部边缘的垂直坐标
Width条形码的宽度 条形码的高度
Height
Text条形码数据,可通过在条形码数据字符串后追加以下内容旋转条形码:/RC = 顺时针旋转 /RA = 逆时针旋转 /RU = 旋转 180 度
Barcode1 = Code39(或 Code 3 of 9);2 = EAN-13;3 = Code128;4 = PostNet;5 = Interleaved 2 of 5
OptionsCode39:0 = 默认绘制 EAN-13:0 = 仅绘制条码 1 = 延伸保护条 2 = 绘制人类可读数字 3 = 绘制带右侧间隔的人类可读数字 Code128:0 = 默认绘制 PostNet:0 = 默认绘制 Interleaved 2 of 5:0 = 不添加校验和,无承载条 1 = 添加校验和字符,无承载条 2 = 不添加校验和,绘制承载条 3 = 添加校验和字符,绘制承载条 要对条码应用 10% 条宽缩减,请将 Options 参数值增加 10

返回值

0无法绘制条形码。Barcode 或 Options 参数无效
1条形码已成功绘制