ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV, WEBDEV and WINDEV Mobile 2025 feature!
Help / WLanguage / WLanguage functions / Standard functions / PDF functions
  • Properties specific to pdfControlOption variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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.
Example
// Get controls present in the PDF file. 
// The different controls of the PDF file are displayed in a Looper control
// Each characteristic of the control corresponds to a row in the Looper control

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)
		// Add details in the Looper 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
// click code of the Modify button
// (button for each control to be modified)
// Get characteristics of the control to be modified
let PageNum = ATT_PageNum
let ControlNum = ATT_ControlNum
let Value = ATT_Value
// Trace("PageNum = " + PageNum + "   ControlNum = " + ControlNum + "   Value = " + Value)

// Assign value to pdfDocument variable
CurrentPDF.Page[PageNum].Control[ControlNum].Value = Value

// Modify PDF file
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 nameType usedEffect
CaptionCharacter stringOption caption.
This property is read-only.
SelectedBoolean
  • True if the option is selected,
  • False otherwise.
Minimum version required
  • Version 2025
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/18/2024

Send a report | Local help