API referenceGraphics

pdfInsertBarcodeStr

The convenience form of pdfInsertBarcode: place a

C
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);
Delphi
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.

ParameterDescription
IPDFDocument handle.
PosX, PosY, Width, HeightPlacement rectangle.
HAlign, VAlignAlignment of the rendered code inside the rectangle.
BarcodeTypeThe symbology, as for pdfInsertBarcode.
DataThe payload string.
ShowTextRender 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)

wrappers/dotnet/LumasPdf.cs
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);
Area
Graphics
Category

Core

Exported names

pdfInsertBarcodeStrW pdfInsertBarcodeStrA

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.