If you have a problem understanding how the hook works, check: Hook's mechanism
Available from version: 1.0.0
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). A watermark is placed on every page of the document.
Parameter name in JSON configuration | From version | Description | Paremeter type | Comments and restrictions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
documentClassId* | 1.0.0 | The document class id indicates for which documents the watermark insertion parameters are to be considered. | Integer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark type* | 1.0.0 | Specifies what type of watermark is. | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark text* | 1.0.0 | Takes the text value that is used to create the watermark. In order to use document index values, the index id should be enclosed in curly braces {}. It is possible to use more than one index value in a parameter. Each subsequent index must be followed by curly braces. Example. Case number: "{8}, Registration Date {9}" Watermark text -> Case number: 433589, Registration Date: 13-02-2021
| Text | Any typed index ids in the text string must exist in the document class specified by the documentClass parameter. If the document being viewed does not contain an index value (it is empty) whose id is given in curly braces in this parameter, the id will be replaced with the empty string "". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark positionX%* | 1.0.0 | Indicates the X (horizontal) position of the watermark in percent relative to the document page dimensions. | Integer | Value between 0 and 100. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark positionY%* | 1.0.0 | Indicates the Y (vertical) position of the watermark in percent relative to the document page dimensions. | Integer | Value between 0 and 100. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark opacity* | 1.0.0 | Specifies the transparency of the inserted watermark on the pages of the document. | Float | Value between 0.0 and 1.0. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark alignment* | 1.0.0 | Specifies relative to which of the four corners of the document page the position of the watermark will be calculated based on the positionX% and positionY% parameters. | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark anchor* | 1.0.0 | Specifies the position of the watermark in relation to the corresponding corner of the watermark. | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark watermarkBarcode format | 1.0.0 | Specifies standard for one-dimensional barcodes (writing information on one line, in the form of dashes). | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark watermarkBarcode codeWidth | 1.0.0 | Defines the width of the barcode in pixels. | Integer | 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 watermarkBarcode codeHeight | 1.0.0 | Defines the height of the barcode in pixels. | Integer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark watermarkText size | 1.0.0 | Text size. | Float | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark watermarkText encoding | 1.0.0 | Character encoding. | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark watermarkText color | 1.0.0 | The color of the text. | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark watermarkText fontType | 1.0.0 | Text font type. | Text |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
watermark watermarkText rotation | 1.0.0 | Watermark rotation. | Float | The value between 0.0 and 360.0. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Permissions groups | 1.0.0 | Permissions defining for which users logged in to the system the hook will be run when trying to open a document. | Array of text values | Optional parameter, when is not filled, everyone can see the watermark. |
[ { "documentClassId": 5, "watermark": { "type": "TEXT", "text": "Case number: {10}, Registration date: {11}", "positionX%": 5, "positionY%": 5, "opacity": 0.7, "alignment": "TOP_LEFT", "anchor": "BOTTOM_LEFT", "watermarkText":{ "size": 15, "encoding": "CP1252", "color": "LIGHT_GRAY", "fontType": "HELVETICA", "rotation": 0 } }, "permissions": { "groups": ["Users", "Administrators"] } }, { "documentClassId": 5, "watermark": { "type": "BARCODE", "text": "{10}", "positionX%": 80, "positionY%": 10, "opacity": 0.5, "alignment": "TOP_LEFT", "anchor": "BOTTOM_LEFT", "watermarkBarcode":{ "format": "CODE_128", "codeWidth": 50, "codeHeight": 15 } }, "permissions": { "groups": ["Users", "Administrators"] } } ]
Example of use for the above JSON configuration.
Original document:
After opening:
1.0.0
- Hook adding