← Powrót do listy dostępnych hook'ów

Jeśli masz problem ze zrozumieniem jak działają hook'i, sprawdź opis: Mechanizm hook'ów

Dostępny od: 1.0.17

Hook pełni funkcję umieszczania znaku wodnego na dokumencie w czasie jego wyświetlania. Jest on zaimplementowany na podstawie definicji hook'a systemowego ReadFileHookAdapter, który umożliwia zmianę strumienia binarnego wyświetlanego dokumentu z archiwum lub w podglądzie w procesie. Konfiguracja hook'a wstawiającego znak wodny jest określana w formacie JSON pod postacią listy i zarządzana jest przez wtyczkę PCM (Plugin Configuration Manager).

Nazwa parametruOd wersjiNazwa parametru w konfiguracji JSONOpisTyp parametruUwagi i ograniczenia
Identyfikator klasy dokumentów1.0.17documentClassIdKlasa dokumentów wskazuje dla których dokumentów mają być brane pod uwagę parametry wstawiania znaku wodnego.Całkowity

 

Typ1.0.17typeOkreśla jakiego typu jest znak wodny.
Tekstowy
WartośćZnaczenie
BARCODEKod kreskowy
Format1.0.17formatOkreśla standard kodów kreskowych w postaci jednowymiarowej (zapis informacji w jednej linii, w formie kresek). Tekstowy
WartośćZnaczenie
CODE_39Kod kreskowy zawierający znaki alfanumeryczne o zmiennej długości, pozwalający zapisać 43 różne znaki. Każdy ze znaków składa się z 9 elementów (słupki jasne i ciemne), z których 3 są znacząco szersze. Ten format pozwala na zakodowanie liczb, wielkich liter i znaków (-, ., (spacja), $, /, +, %, *).
CODE_93Kod kreskowy będący udoskonaleniem formatu CODE_39. Podobnie jak swój pierwowzór przechowuje 43 znaki alfanumeryczne, ale dodatkowo posiada 4 znaki sterujące (($), (%), (/), (+)).
Kod przyjmuje wyłącznie wielkie litery.
CODE_128Kod alfanumeryczny o zmiennej długości i wysokiej gęstości. Potrafi kodować znaki z całego zakresu ASCII.
Identyfikator indeksu1.0.17indexIdWskazuje na indeks, z którego jest pobierana wartość do zakodowania w znaku wodnym.CałkowityWartość indeksu musi być typu tekstowego.
Szerokość znaku wodnego1.0.17codeWidthDefiniuje szerokość znaku wodnego w pikselach.CałkowityParametr nie definiuje maksymalnej szerokości kodu kreskowego - w przypadku, gdy podstawiana wartość okaże się zbyt długa, szerokość automatycznie zostanie zwiększona.
Wysokość znaku wodnego1.0.17codeHeightDefiniuje długość znaku wodnego w pikselach.Całkowity 
Umiejscowienie1.0.17positionPozycjonuje znak wodny w odpowiedniej części strony. Do wykorzystania jest 9 predefiniowanych pozycji.Tekstowy
WartośćZnaczenie
TOP_RIGHTGórny prawy róg
TOP_LEFTGórny lewy róg
BOTTOM_RIGHTDolny prawy róg
BOTTOM_LEFTDolny lewy róg
TOPU góry na środku
BOTTOMNa dole na środku
LEFTNa środku po lewej stronie
RIGHTNa środku po prawej stronie
CENTERNa środku
Margines1.0.17marginDefiniuje odstęp znaku wodnego od określonej krawędzi strony w zależności od wartości parametru Umiejscowienie np. gdy wspomniany parametr ma wartość TOP, to margines odnosi się do górnej krawędzi strony dokumentu.
Zmiennoprzecinkowy 
Przezroczystość1.0.17opacityOkreśla przezroczystość wstawianego znaku wodnego na stronach dokumentu.ZmiennoprzecinkowyWartość z przedziału 0-1.
Uprawnienia1.0.17

permissions

Uprawnienia określające dla jakich zalogowanych użytkowników w systemie przy próbie otwarcia dokumentu zostanie uruchomiony hook.ObiektParametr opcjonalny, gdy nie jest uzupełniony to znak wodny widzą wszyscy.
groupsWskazuje na grupy użytkowników systemowych.Tablica tekstowa 

 

[
  {
   "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

  • Dodanie hook'a

← Return to the list of hooks

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

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 

 

[
  {
   "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