Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Insert Document Status for Files in PDF format
Groovy Script - Insert Document Status for Files in PDF format
Updated over a week ago

Description: Sample groovy script to insert document status for files in PDF format

Context: Document

Remark: Accessible in 'Pre' task mode only

Script:

def execute(){

EmbedAttributeConfigEntity embedAttributeConfigEntity = new EmbedAttributeConfigEntity();

embedAttributeConfigEntity.setApplyOnAllPage(false);

embedAttributeConfigEntity.setDisplacementTop(0);

embedAttributeConfigEntity.setDisplacementBottom(0);

embedAttributeConfigEntity.setDisplacementRight(0);

embedAttributeConfigEntity.setDisplacementLeft(0);

embedAttributeConfigEntity.setAttributePosition(Location.TOP_LEFT);

embedAttributeConfigEntity.setMeasureIn(MeasureIn.PIXEL);

embedAttributeConfigEntity.setAttributeLblPrefix("View Doc Status : ");

embedAttributeConfigEntity.setFontSize(20);

embedAttributeConfigEntity.setColor("#cc0099");

embedAttributeConfigEntity.setFont(EntityFontType.TIMES_ROMAN);

embedAttributeConfigEntity.setBold(true);

embedAttributeConfigEntity.setItalic(true);

Map<SystemAttributeBanner, EmbedAttributeConfigEntity> sysAttributes = new HashMap<SystemAttributeBanner, EmbedAttributeConfigEntity>();

sysAttributes.put(SystemAttributeBanner.STATUS, embedAttributeConfigEntity);

return documentService.embedAttributesInFile(sysAttributes);

}



Did this answer your question?