Skip to end of metadata
Go to start of metadata

← 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_39

Barcode 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), $, /, +,%, *).

CharValueCharValueCharValueCharValue
00B11M22X33
11C12N23Y34
22D13O24Z35
33E14P25-36
44F15Q26.37
55G16R27space38
66H17S28$39
77I18T29/40
88J19U30+41
99K20V31%42
A10L21W32  

CODE_93

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

 CharValueCharValueCharValueCharValue
00C12O24-36
11D13P25.37
22E14Q26space38
33F15R27$39
44G16S28/40
55H17T29+41
66I18U30%42
77J19V31($)43
88K20W32(%)44
99L21X33(/)45
A10M22Y34(+)46
B11N23Z35  

Code 93

CODE_128

Variable length, high density alphanumeric code. It can encode characters from the entire ASCII range.

Code_128B-2009-06-02.svg.png

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

1.0.26 (applicable documentation)

  •  Fix the situation where there is no user context

1.0.X

  •  Adding a @Deprecated Annotation

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.