PdfRadioButtonListItem
12 Sep 20253 minutes to read
PdfRadioButtonListItem class represents the radio button field item 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) as PdfPage;
// 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);
// Create and add third item
let third: PdfRadioButtonListItem = new PdfRadioButtonListItem('50-59', {x: 100, y: 200, width: 20, height: 20}, field);
field.add(third);
// 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();Properties
author string
Gets the author of the annotation.
backColor number[]
Gets the back color of the annotation.
border PdfAnnotationBorder
Gets the border of the annotation.
borderColor number[]
Gets the border color of the annotation.
bounds Object
Gets the bounds of the annotation.
caption PdfAnnotationCaption
Gets the caption of the annotation.
checked boolean
Gets the flag to indicate whether the field item is checked or not.
color number[]
Gets the fore color of the annotation.
creationDate Date
Gets the creation date of the annotation.
exportValue string
Gets the export value of the check box field.
flags PdfAnnotationFlag
Gets the flags of the annotation.
flatten boolean
Gets the boolean flag indicating whether the annotation have been flattened or not.
flattenPopups boolean
Gets the boolean flag indicating whether annotation’s popup have been flattened or not.
font PdfFont
Gets the font of the item.
highlightMode PdfHighlightMode
Gets the highlight mode of the annotation.
innerColor number[]
Gets the inner color of the annotation.
layer PdfLayer
Gets the PdfLayer of the annotation.
modifiedDate Date
Gets the modification date of the annotation.
name string
Gets the name of the annotation.
opacity number
Gets the opacity of the annotation.
page PdfPage
Gets the page object (Read only).
rotate number
Gets the rotation angle of the annotation.
rotationAngle PdfRotationAngle
Gets the rotation of the annotation.
selected boolean
Gets the flag to indicate whether the field item is selected or not.
style PdfCheckBoxStyle
Gets the style of annotation.
subject string
Gets the subject of the annotation.
text string
Gets the text of the annotation.
textAlignment PdfTextAlignment
Gets the text alignment of the annotation.
value string
Gets the value of the radio button list field item
visibility PdfFormFieldVisibility
Gets the visibility.
Methods
getValues
Gets the values associated with the specified key.
| Parameter | Type | Description |
|---|---|---|
| name | string |
Key. |
Returns string[]
setAppearance
Set the boolean flag to create a new appearance stream for annotations.
| Parameter | Type | Description |
|---|---|---|
| value | boolean |
Set appearance. |
Returns void
setValues
Sets the values associated with the specified key.
| Parameter | Type | Description |
|---|---|---|
| name | string |
Key. |
| value | string |
Value associated with the key.. |
Returns void