DrawMaxiCode

Small Business、条码

需要 Small Business 版 — 在 Delphi、C++Builder 和 Lazarus 代码中,请将库创建为 TPDFlibSmallBusiness(单元 PDFlibSmallBusiness)或 TPDFlibEnterprise;Small Business 版和 Enterprise 版的 DLL 与 ActiveX 构建原样提供该方法;Single 版保留此方法,它返回 0,并将 LastErrorCode 设置为 901(PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

描述

在选定页面的指定矩形内绘制 MaxiCode 符号,把 Text 编码为主消息,并在模式 2 和 3 下把 Primary 编码为结构化邮政消息

语法

Delphi

Function TPDFlib.DrawMaxiCode(Left, Top, Width, Height: Double; Const Text, Primary: WideString; Mode: Integer): Integer; Virtual;

ActiveX

Function PDFlib::DrawMaxiCode(Left As Double, Top As Double, Width As Double, Height As Double, Text As String, Primary As String, Mode As Long) As Long

DLL

int DLDrawMaxiCode(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t* Text, const wchar_t* Primary, int Mode);
int DLDrawMaxiCodeA(int InstanceID, double Left, double Top, double Width, double Height, const char* Text, const char* Primary, int Mode);

参数

Left符号矩形左下角的水平坐标,单位为当前度量单位
Top符号矩形左下角的垂直坐标,单位为当前度量单位
Width指定矩形的宽度,单位为当前度量单位;必须为正且有限
Height指定矩形的高度,单位为当前度量单位;必须为正且有限
Text编码进符号的主消息载荷
Primary模式 2 和 3 的次要消息:邮政编码,后接三位国家代码和三位服务类别;模式 4 到 6 下必须为空
Mode符号模式,取 2 到 6;模式 2 接受 1 到 9 位邮政编码数字,模式 3 接受 1 到 6 位邮政编码字母、数字或空格,模式 4 和 5 不携带主消息,模式 6 保留供扫描器维护使用

返回值

1符号已编码并绘制到选定页面上
0未绘制任何内容;输入或几何参数无效时 LastErrorCode 为 904,编码器运行库不可用或不兼容时为 903,实例不提供 Small Business 版时为 901

Mode 取 2 到 6;模式 2 和 3 要求 Primary 包含邮政编码,后接三位国家代码和三位服务类别

模式 2 接受 1 到 9 位邮政编码数字;模式 3 接受 1 到 6 位邮政编码字母、数字或空格;模式 4 到 6 要求主字符串为空;模式 6 保留供扫描器维护使用

载荷为 Text;指定矩形会保持符号的宽高比、六边形单元与中心定位图形

PDF.DrawMaxiCode(50, 700, 100, 100, 'Shipment 12345', '', 4);

成功返回 1,失败返回 0;版本要求、部署与错误说明见 专业条码