Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Enable 'Include QR code' option in download preference
Groovy Script - Enable 'Include QR code' option in download preference
Updated this week

Description: Sample groovy script to enable 'Include QR code' option in download preference. Applicable for both 'Static' and 'Dynamic' QR code type.

Click here for detailed help.

Context: Document

Remark: Accessible in 'On Load' task mode only

Script:

def execute(){

boolean checked = true;

boolean unchecked = false;

DocumentVO document = documentService.getDocumentDetails();

JsonArray optionList = new JsonArray();

JsonObject qrCodeOption = new JsonObject();

qrCodeOption.addProperty(IGroovyConstant.VISIBLE, true);

qrCodeOption.addProperty(IGroovyConstant.EDITABLE, true);

qrCodeOption.addProperty(IGroovyConstant.DEFAULT_VALUE, checked);

qrCodeOption.addProperty(IGroovyConstant.OPTION_NAME, IGroovyConstant.EMBED_QR_CODE_OPTION);

optionList.add(qrCodeOption);

/*

JsonObject fileRenameOption = new JsonObject();

fileRenameOption.addProperty(IGroovyConstant.VISIBLE, true);

fileRenameOption.addProperty(IGroovyConstant.EDITABLE, true);

fileRenameOption.addProperty(IGroovyConstant.DEFAULT_VALUE, unchecked);

fileRenameOption.addProperty(IGroovyConstant.OPTION_NAME, IGroovyConstant.RENAME_FILE_OPTION);

optionList.add(fileRenameOption);

*/

document.setResponseStatus(false);

document.setDynamicObject(optionList.toString());

return document;

}



Did this answer your question?