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);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Name | Field name. |
ExpValue | The export (/AS//V) value when checked. |
Checked | Non-zero for initially checked. |
Parent | Accepted but silently dropped. |
PosX, PosY, Width, Height | Placement box. |
Return value. The new field's handle; 0 if IPDF is invalid.
C# (P/Invoke)
public static extern int pdfCreateCheckBox(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string Name, [MarshalAs(UnmanagedType.LPStr)] string ExpValue, int @Checked, int Parent, double PosX, double PosY, double Width, double Height);
Object Creation
pdfCreateCheckBox
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.