API referenceForms

pdfCreateRadioButton

Create a checkbox or radio-button (/FT /Btn) field with a

C
int32_t __stdcall pdfCreateCheckBox(PPDF IPDF, const char* Name, const char* ExpValue, int32_t Checked, int32_t Parent, double PosX, double PosY, double Width, double Height);
int32_t __stdcall pdfCreateRadioButton(PPDF IPDF, const char* Name, const char* ExpValue, int32_t Checked, int32_t Parent, double PosX, double PosY, double Width, double Height);
Delphi
function pdfCreateCheckBox(const IPDF: PPDF; const Name, ExpValue: PAnsiChar; Checked, Parent: Integer; PosX, PosY, Width, Height: Double): Integer; stdcall;
function pdfCreateRadioButton(const IPDF: PPDF; const Name, ExpValue: PAnsiChar; Checked, Parent: Integer; PosX, PosY, Width, Height: Double): Integer; stdcall;

Purpose. Create a checkbox or radio-button (/FT /Btn) field with a given export value and initial checked state.

Description. A radio button created this way is not automatically grouped with any sibling radio buttons sharing the same visual choice set — the PDF /Btn radio-group relationship (multiple widgets sharing one field, mutually exclusive) is not established by repeated calls to this function; grouping, if supported at all in this SDK, is not reachable through this entry point (no group-forming parameter survives to the implementation — see the chapter-wide Parent-drop note).

Parameters.

ParameterDescription
IPDFDocument handle.
NameField name.
ExpValueThe export (/AS//V) value when checked.
CheckedNon-zero for initially checked.
ParentAccepted but silently dropped.
PosX, PosY, Width, HeightPlacement box.

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

C# (P/Invoke)

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

Object Creation

Exported names

pdfCreateRadioButton

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.