Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

← Return to the list of hooks

If you have a problem understanding how the hook works, check: Hook's mechanism

Basic information

Available from version: 1.0.17

Description

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).

Configuration parameters

Parameter name

From version

Parameter name in JSON configuration

Description

Paremeter type

Comments and restrictions

Document Class ID

1.0.17

documentClassIdThe document class indicates for which documents the watermark insertion parameters are to be considered.

Integer

 
Type 
1.0.17typeSpecifies what type of watermark is.Text
ValueMeaning
BARCODEBarcode
Format
1.0.17formatSpecifies standard for one-dimensional barcodes (writing information on one line, in the form of dashes). Text
ValueMeaning
CODE_39Barcode with variable-length alphanumeric characters to store 43 different characters. Each sign consists of 9 elements (light and dark bars), 3 of which are significantly wider. This format allows you to encode numbers, capital letters and characters (-, ., (Space), $, /, +,%, *).
CODE_93The barcode is an improvement of the CODE_39 format. Like its prototype, it stores 43 alphanumeric characters, but additionally has 4 control characters (($), (%), (/), (+)).
The code accepts only uppercase letters.
CODE_128Variable length, high density alphanumeric code. It can encode characters from the entire ASCII range.
Index ID
1.0.17indexIdIndicates the index from which the value to be encoded in the watermark is taken.IntegerThe index value must be of the text type.
Watermark width1.0.17codeWidthDefines the width of the watermark in pixels.TextThe 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.17codeHeightDefines the height of the watermark in pixels.Text 
Position1.0.17positionPositions the watermark on the appropriate part of the page. There are 9 predefined positions to use.Text
ValueMeaning
TOP_RIGHTUpper right corner
TOP_LEFTUpper left corner
BOTTOM_RIGHTLower right corner
BOTTOM_LEFTLower left corner
TOPTop middle
BOTTOMBottom middle
LEFTLeft middle
RIGHTRight middle
CENTERMiddle
Margin1.0.17marginDefines 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 
transparency1.0.17opacitySpecifies the transparency of the inserted watermark on the pages of the document.FloatValue in the range 0-1.
Permissions1.0.17permissionsPermissions defining for which users logged in to the system the hook will be run when trying to open a document.ObjectOptional parameter, when is not filled, everyone can see the watermark.
groupsIndicates groups of system users.Text table 
Configuration example

 

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
    }
  }
]
Change log

1.0.17

  • Hook adding

  • No labels