Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Embed QR code (of 'Dynamic' type) while downloading and printing the document (Supported in Asite Viewer supported file formats only)
Groovy Script - Embed QR code (of 'Dynamic' type) while downloading and printing the document (Supported in Asite Viewer supported file formats only)
Updated this week

Description: Sample groovy script to embed QR code (of 'Dynamic' type) while downloading & printing the document (Supported in Asite Viewer supported file formats only)

Click here for detailed help.

Context: Document

Remark: Accessible in 'Pre' task mode only

Script:

def execute(){

DocumentVO document = documentService.getDocumentDetails();

boolean success = false;

if ((!document.getFileName().endsWith(".pdf") && !document.getFileName().endsWith(".PDF")) && documentService.isQRCodeEnabled(document, IGroovyConstant.FOLDER_LEVEL)) {

if(documentService.applyQRCode(document)) document.setExecutionStatus(Status.SUCCESS);

else document.setExecutionStatus(Status.FAILED);

} else {

document.setExecutionStatus(Status.NOT_REQUIRED);

}

document.setResponseStatus(false);

return document;

}



Did this answer your question?