Skip to content

Stamp

The stamp feature allows administrators to insert images, text, or barcodes into PDF documents.

Stamps are shown in a table structure.

Id Name Description Text Script Color Users Active

Field descriptions:

Field Description
Name Stamp name.
Description Stamp description.
Text The text to be shown on the stamp.
Script When set, the result of the script will be the stamped text.
List of variables that can be used directly:
| Variable | Description |
| — | — |
| document | Document object of the document node.
For more information see the com.openkm.bean.Document class at API description. |
Sample:
<br>import java.util.*;<br>String value = "";<br>value = document.getActualVersion().getName();<br>value += "-" + String.valueOf(new Date());<br>return value;<br>
Sample:
<br>import org.springframework.web.context.*;<br>import com.openkm.util.*;<br>import com.openkm.api.*;<br>WebApplicationContext cc = (WebApplicationContext) ContextWrapper.getContext();<br>OKMPropertyGroup okmPrpGrp = cc.getBean(OKMPropertyGroup.class);<br>String prpGrpName = "okg:sample";<br>if (okmPrpGrp.hasGroup(null, document.getUuid(), prpGrpName)) {<br> Map props = okmPrpGrp.getProperties(null, document.getUuid(), prpGrpName);<br> return "Number: " + props.get("okp:sample.number");<br>} else {<br> return "No property group assigned: " + prpGrpName;<br>}<br>
Font unicode.ttf
The font file must be copied into the $TOMCAT_HOME/lib folder.
Layer Position of the stamped image.
Available values:
- Under content.
- Over content.
Opacity The text opacity. The range of allowed values is from 0 to 1.
An Opacity equal to 0 means the text or image is transparent and you won’t see it. Set it to 0.5 to see semi-transparent text or to 1 to be opaque.
Also try changing the layer to stamp over or below the default text layer.
Size Text size.
Align Text alignment.
Available values:
- Left.
- Center.
- Right.
Rotation Text rotation. The range of allowed values is from 0 to 360.
Color The text color.
Expr. X Expression to set the position in X coordinates.
Expr. Y Expression to set the position in Y coordinates.
Active When enabled the stamp will be available to the users.
Users List of users who can use the stamp.