DrawMaxiCode

Small Business, barcodes

Requires the Small Business edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibSmallBusiness (unit PDFlibSmallBusiness) or TPDFlibEnterprise; the Small Business and Enterprise DLL and ActiveX builds provide it unchanged; the Single edition keeps the method, which returns 0 and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

Description

Draws a MaxiCode symbol into the requested box on the selected page, encoding Text as the primary message and, in modes 2 and 3, Primary as the structured postal message

Syntax

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);

Parameters

LeftHorizontal coordinate of the lower-left corner of the symbol box, in the current measurement units
TopVertical coordinate of the lower-left corner of the symbol box, in the current measurement units
WidthWidth of the requested box in the current measurement units; must be positive and finite
HeightHeight of the requested box in the current measurement units; must be positive and finite
TextPrimary message payload encoded in the symbol
PrimarySecondary message for modes 2 and 3: the postal code followed by the three-digit country code and three-digit service class; must be empty for modes 4 through 6
ModeSymbol mode from 2 through 6; mode 2 accepts one through nine postal-code digits, mode 3 accepts one through six postal-code letters, digits or spaces, modes 4 and 5 carry no primary message, and mode 6 is reserved for scanner maintenance

Return values

1The symbol was encoded and drawn on the selected page
0Nothing was drawn; LastErrorCode is 904 for invalid input or geometry, 903 when the encoder runtime is unavailable or incompatible, or 901 when the instance does not provide the Small Business edition

Mode accepts 2 through 6; modes 2 and 3 require Primary containing the postal code followed by the three-digit country code and three-digit service class

Mode 2 accepts one through nine postal-code digits; mode 3 accepts one through six postal-code letters, digits or spaces; modes 4 through 6 require an empty primary string; mode 6 is reserved for scanner maintenance

The payload is Text; the requested box preserves the symbol aspect ratio, hexagonal cells and central target

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

Returns 1 on success or 0 on failure; Professional barcodes describes edition requirements, deployment and errors