setFormCreationMode method
Used to add a specified form field type when touching the page in form creation mode This method is only available in CPDFViewMode.forms mode. Example:
await controller.setFormCreationMode(CPDFFormType.text);
Throws an exception if called in a mode other than CPDFViewMode.forms.
Implementation
Future<void> setFormCreationMode(CPDFFormType type) async {
var viewMode = await getPreviewMode();
if(viewMode != CPDFViewMode.forms) {
throw Exception(
'setFormCreationMode is only available in CPDFViewMode.forms mode, current mode is $viewMode');
}
await _channel.invokeMethod('set_form_creation_mode', type.name);
}