Description: Sample Groovy Script to embed QR code (of 'Dynamic' type) when downloading & printing the document (Supported in Asite Viewer- supported file formats only).
Click here to learn more.
Context: Document
Document Type: File
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;
}