If you have a problem understanding how the hook works, check: Hook's mechanism
Available from version: 1.0.17
Hook places a watermark on the document as it is displayed. This hook is implemented based on the definition of the ReadFileHookAdapter system hook, which allows to change the binary stream of the displayed document from archive or in preview in the process. Configuration of the watermark insert hook is defined in JSON format as a list and is managed by the PCM (Plugin Configuration Manager).
Parameter name | From version | Parameter name in JSON configuration | Description | Paremeter type | Comments and restrictions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Document Class ID | 1.0.17 | documentClassId | The document class indicates for which documents the watermark insertion parameters are to be considered. | Integer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type | 1.0.17 | type | Specifies what type of watermark is. | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format | 1.0.17 | format | Specifies standard for one-dimensional barcodes (writing information on one line, in the form of dashes). | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Index ID | 1.0.17 | indexId | Indicates the index from which the value to be encoded in the watermark is taken. | Integer | The index value must be of the text type. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Watermark width | 1.0.17 | codeWidth | Defines the width of the watermark in pixels. | Text | The parameter does not define the maximum width of the barcode - in the case when the substituted value turns out to be too long, the width will be automatically increased. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Watermark height | 1.0.17 | codeHeight | Defines the height of the watermark in pixels. | Text | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Position | 1.0.17 | position | Positions the watermark on the appropriate part of the page. There are 9 predefined positions to use. | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Margin | 1.0.17 | margin | Defines the distance of the watermark from the specified edge of the page depending on the value of the Location parameter, e.g. when the mentioned parameter is TOP, the margin refers to the top edge of the document page. | Float | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
transparency | 1.0.17 | opacity | Specifies the transparency of the inserted watermark on the pages of the document. | Float | Value in the range 0-1. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Permissions | 1.0.17 | permissions | Permissions defining for which users logged in to the system the hook will be run when trying to open a document. | Object | Optional parameter, when is not filled, everyone can see the watermark. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
groups | Indicates groups of system users. | Text table |
Example JSON configuration
[
{
"documentClassId": 2,
"watermark": {
"type": "BARCODE",
"format": "CODE_128",
"indexId": 2,
"codeWidth": 30,
"codeHeight": 30,
"position": "RIGHT",
"margin": 5.0,
"opacity": 0.5
},
"permissions": {
"groups": ["Users", "Administrators"]
}
},
{
"documentClassId": 1,
"watermark": {
"type": "BARCODE",
"format": "CODE_128",
"indexId": 2,
"codeWidth": 60,
"codeHeight": 60,
"position": "LEFT",
"margin": 5.0,
"opacity": 0.5
}
}
]
1.0.17
- Hook adding
1.0.26 (applicable documentation)
- Fix the situation where there is no user context
1.0.X
- Adding a @Deprecated Annotation
0 Comments