PdfRadioButtonListField
class represents the radio button field objects.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data);
// Gets the first page of the document
let page: PdfPage = document.getPage(0);
// Access the PDF form
let form: PdfForm = document.form;
// Create a new radio button list field
let field: PdfRadioButtonListField = new PdfRadioButtonListField(page, 'Age');
// Create and add first item
let first: PdfRadioButtonListItem = field.add('1-9', {x: 100, y: 140, width: 20, height: 20});
// Create and add second item
let second: PdfRadioButtonListItem = new PdfRadioButtonListItem('10-49', {x: 100, y: 170, width: 20, height: 20}, page);
field.add(second);
// Sets selected index of the radio button list field
field.selectedIndex = 0;
// Add the field into PDF form
form.add(field);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
number[]
Gets the background color of the field.
PdfInteractiveBorder
Gets the width, style and dash of the border of the field.
number[]
Gets the border color of the field.
Object
Gets the bounds.
boolean
Gets the flag indicating whether the field is checked or not (Read only).
number[]
Gets the fore color of the field.
boolean
Gets a value indicating whether the field is allow to export data or not.
boolean
Gets the boolean flag indicating whether the form field have been flattened or not.
PdfForm
Gets the form object of the field (Read only).
number
Gets the count of the loaded field items (Read only).
string
Gets the mapping name to be used when exporting interactive form field data from the document.
string
Gets the name of the field (Read only).
PdfPage
Gets the page object of the form field (Read only).
boolean
Gets a value indicating whether read only.
boolean
Gets a value indicating whether the field is required.
number
Gets the rotation angle of the field.
PdfRotationAngle
Gets the rotation of the field (Read only).
number
Gets the selected item index.
number
Gets the tab index of annotation in current page.
string
Gets the tool tip of the form field.
PdfFormFieldVisibility
Gets the form field visibility.
boolean
Gets a value indicating the visibility of the field (Read only).
Add list item to the field.
Parameter | Type | Description |
---|---|---|
item | PdfRadioButtonListItem |
List item. |
Returns number
Add list item to the field.
Parameter | Type | Description |
---|---|---|
value | string |
Name of the list item. |
bounds | Object |
Bounds of the list item. |
Returns PdfRadioButtonListItem
Gets the value associated with the specified key.
Parameter | Type | Description |
---|---|---|
name | string |
Key. |
Returns string
Gets the item at the specified index.
Parameter | Type | Description |
---|---|---|
index | number |
Index of the field item. |
Returns PdfRadioButtonListItem
Remove the specified radio button list field item.
Parameter | Type | Description |
---|---|---|
item | PdfRadioButtonListItem |
Item to remove. |
Returns void
Remove the radio button list item from the specified index.
Parameter | Type | Description |
---|---|---|
index | number |
Item index to remove. |
Returns void
Sets the flag to indicate the new appearance creation.
Parameter | Type | Description |
---|---|---|
value | boolean |
Set appearance. |
Returns void
Sets the value associated with the specified key.
Parameter | Type | Description |
---|---|---|
name | string |
Key. |
value | string |
Value associated with the key.. |
Returns void