pdfCreateBarcodeField
Create a barcode-bearing widget field — a form field whose
int32_t __stdcall pdfCreateBarcodeField(PPDF IPDF, const char* Name, int32_t Parent, double PosX, double PosY, double Width, double Height, TPDFBarcode* Barcode);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Name | Field name. |
Parent | Accepted but silently dropped. |
PosX, PosY, Width, Height | Placement box. |
Barcode | Only CaptionA/CaptionW are read. |
Return value. The new field's handle; 0 if IPDF is invalid.
See also. pdfGetBarcodeDict.
C# (P/Invoke)
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);
Object Creation
pdfCreateBarcodeField
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.