API referenceForms

pdfCreateBarcodeField

Create a barcode-bearing widget field — a form field whose

C
int32_t __stdcall pdfCreateBarcodeField(PPDF IPDF, const char* Name, int32_t Parent, double PosX, double PosY, double Width, double Height, TPDFBarcode* Barcode);
Delphi
function pdfCreateBarcodeField(const IPDF: PPDF; const Name: PAnsiChar; Parent: Integer; PosX, PosY, Width, Height: Double; Barcode: PPDFBarcode): Integer; stdcall;

Purpose. Create a barcode-bearing widget field — a form field whose visible appearance is a QR code rendered from the field's own caption text (the same IBarcode-object-descriptor-bearing field consumed by pdfGetBarcodeDict, Barcodes and Optional-Content (OCG) State).

Description. Only Barcode.CaptionA/CaptionW are consulted (A preferred if both are set; W UTF-8-encoded if only that is set) — every other TPDFBarcode field is ignored, consistent with that struct's deliberately caption-only shape (Barcodes and Optional-Content (OCG) State). Parent is, per the chapter-wide note, silently dropped.

Parameters.

ParameterDescription
IPDFDocument handle.
NameField name.
ParentAccepted but silently dropped.
PosX, PosY, Width, HeightPlacement box.
BarcodeOnly CaptionA/CaptionW are read.

Return value. The new field's handle; 0 if IPDF is invalid.

See also. pdfGetBarcodeDict.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfCreateBarcodeField(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string Name, int Parent, double PosX, double PosY, double Width, double Height, ref TPDFBarcode Barcode);
Area
Forms
Category

Object Creation

Exported names

pdfCreateBarcodeField

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.