|
|
|
|
|
- Properties specific to pdfControlOption variables
pdfControlOption (Variable type) In french: pdfOptionChamp
The pdfControlOption type is used to get and set the following characteristics of an option of a control present in a PDF form: - option caption.
- selected or deselected state of the option.
For example: - a Combo Box control or a list in a form contain several options. This allows you to select the desired option.
- a control containing text. You can change the caption of the option, which corresponds to the value displayed in the control.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
LooperDeleteAll(LOOP_Control)
CurrentPDF is pdfDocument = PDF_NoName1.Value
sPath is string = CurrentPDF.Value
Trace(sPath)
FOR i = 1 _TO_ CurrentPDF.Page.Count
page is pdfPage = CurrentPDF.Page[i]
FOR j = 1 _TO_ page.Control..Count
control is pdfControl = page.Control[j]
let sName = control.Nom
let sValue = control.Value
let sType = ControlTypeToReadableFormat(control.Type)
let sOptions = ListOption(control)
LOOP_Control.AddLine(i, j, sName, sType, sValue, sOptions)
IF sValue <> "" THEN
LOOP_Control[LOOP_Control.Count].EDT_Value.BackgroundColor = YellowToolhelp
END
IF sOptions = "" THEN
LOOP_Control[LOOP_Control.Count].EDT_Option.Grayed = True
ELSE
LOOP_Control[LOOP_Control.Count].EDT_Option.Grayed =False
END
END
END
INTERNAL PROCEDURE ListOption(control is pdfControl): string
sOptions is string
FOR i = 1 _TO_ control.Option..Count
IF sOptions <> "" THEN sOptions += CR
sOptions += i + ": " + control.Option[i].Caption
END
RETURN sOptions
END
INTERNAL PROCEDURE ControlTypeToReadableFormat(nType): string
SWITCH nType
CASE typText: RETURN "Edit control"
CASE typComboWE: RETURN "Editable Combo Box"
CASE typComboNE: RETURN "Non-editable Combo Box"
CASE typCheckBox: RETURN "Check Box"
CASE typRadioButton: RETURN "Radio Button"
CASE typList: RETURN "List Box"
OTHER CASE: RETURN "Unknown"
END
END
let PageNum = ATT_PageNum
let ControlNum = ATT_ControlNum
let Value = ATT_Value
CurrentPDF.Page[PageNum].Control[ControlNum].Value = Value
PDF_NoName1 = CurrentPDF
Properties Properties specific to pdfControlOption variables The following properties can be used to handle an option of a control present in a PDF form: | | | Property name | Type used | Effect |
---|
Caption | Character string | Option caption. This property is read-only. | Selected | Boolean | - True if the option is selected,
- False otherwise.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|