SI32 __stdcall pdfInsertBarcodeStrA(PPDF IPDF, double PosX, double PosY, double Width, double Height, TCellAlign HAlign, TCellAlign VAlign, TPDFBarcodeType BarcodeType, const char* Data, BOOL32 ShowText);
SI32 __stdcall pdfInsertBarcodeStrW(PPDF IPDF, double PosX, double PosY, double Width, double Height, TCellAlign HAlign, TCellAlign VAlign, TPDFBarcodeType BarcodeType, const wchar_t* Data, BOOL32 ShowText);
function pdfInsertBarcodeStrA(const IPDF: PPDF; PosX, PosY, Width, Height: Double; HAlign, VAlign: TCellAlign; BarcodeType: TPDFBarcodeType; const Data: PAnsiChar; ShowText: LongBool): Integer; stdcall;
function pdfInsertBarcodeStrW(const IPDF: PPDF; PosX, PosY, Width, Height: Double; HAlign, VAlign: TCellAlign; BarcodeType: TPDFBarcodeType; const Data: PWideChar; ShowText: LongBool): Integer; stdcall;
Purpose. The convenience form of pdfInsertBarcode: place a barcode from just a type, a data string and a flag, without filling a TPDFBarcode2 record.
Description. Builds a default-initialised TPDFBarcode2, sets its BarcodeType, Data and ShowText from the arguments, and forwards to pdfInsertBarcode — placement, alignment and rendering are identical to the record-based call, and every other record property keeps its default. Use the record form when error-correction levels, module sizes, colors or the other barcode options matter.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
PosX, PosY, Width, Height | Placement rectangle. |
HAlign, VAlign | Alignment of the rendered code inside the rectangle. |
BarcodeType | The symbology, as for pdfInsertBarcode. |
Data | The payload string. |
ShowText | Render the human-readable text line where the symbology has one. |
Return value. As pdfInsertBarcode; -1 for a NULL document or data pointer.
C# (P/Invoke)
public static extern int pdfInsertBarcodeStrW(IntPtr IPDF, double PosX, double PosY, double Width, double Height, TCellAlign HAlign, TCellAlign VAlign, int BarcodeType, [MarshalAs(UnmanagedType.LPWStr)] string Data, [MarshalAs(UnmanagedType.Bool)] bool ShowText);
public static extern int pdfInsertBarcodeStrA(IntPtr IPDF, double PosX, double PosY, double Width, double Height, TCellAlign HAlign, TCellAlign VAlign, int BarcodeType, [MarshalAs(UnmanagedType.LPStr)] string Data, [MarshalAs(UnmanagedType.Bool)] bool ShowText);
Core
pdfInsertBarcodeStrW
pdfInsertBarcodeStrA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.