CIB pdf toolbox technical guide (EN)

17. Using test templates

With test templates it is possible to check whether a PDF page contains content, at which position and whether the content is permitted or mandatory at this position or whether it is undesirable.

The special properties to be set are described in detail below.

Propertyname

Type

Functionality

CheckMask

(since CIB pdf toolbox)

String

Describes the structure of the concrete test templates. The individual components are described in more detail below.

Structure:

<Checkmasklist> ::= <Checkmask> | <Checkmask> „;“ <Checkmasklist>

Several definitions for test templates can be strung together. They are separated by semicolons.

Example:

CheckMask=“{{1,3-40}; {forbidden;2cm;2cm;5cm;4cm}}; {{2,5,6};{allowed;2cm;2cm;5cm;4cm};{mandatory;1cm;1cm;6cm;7cm}};“

<Checkmask>

 

String

Description of a template.

Structure:
<Checkmask>::=“{„ <Pages>“;“<mask area> „}“

The template areas are described for the pages for which a test template is to be used.

For each <Checkmask>, either "allowed", "forbidden" or "mandatory" areas or even combinations of these areas can be described.

<mask area>

 

Description of the test template area (rectangle).

Structure:
<mask-area> = {forbidden | allowed | mandatory;left;top;right;bottom[;ID]}

Forbidden        no text allowed in this rectangle

Allowed           text is allowed in this rectangle

Mandatory       This rectangle must contain text

left;top Coordinates of the upper left corner point of the rectangle (see point A)

right;bottom     Coordinates of the lower right corner point of the rectangle (see point B)

ID        Specification of an identifier (ID) that is output in the CheckMaskViolations

The reference point for the coordinates is the upper left corner of the page.

By entering negative values, the reference point can be changed to the lower right corner of the page.

The following units are supported: mm, cm, in, ft;

Default: mm

<Pages>

 

Specifies the pages or page areas on which the following test template is to be applied.

The pages can be specified in relation to the whole document or to a single copy.

If the test template is to be applied to all pages of a copy, "All" must be added to the text marker.

 

Structure:
<Pages>= {[any page number | from-to| All | Even | Odd | NoLast | NoFirst | First | Last]}  

First (only the first page),

NoFirst (no first page),

Last (only the last page),

NoLast (not the last page),

Even (Even numbers)

Odd (Odd numbers)

All (all pages)

Value (This page)

Value1-Value2 (this page area)

  Value1-Value2[,]Value3 (These pages/ page              areas)

 

CheckMaskViolations

String

Property returns the violations of the test templates.

(Get-Property).

An identifier (ID) can be assigned to each test template. This ID is also given in the output.

The following is output:
Position of the text that causes the injury (content).

Position of the Checkmask that is violated (masks).

Example:

…{forbidden;50mm,50mm,150mm,100mm;myid1}.

Violations={{content;49.31;52.84;61.66;50.08;};{masks;{50;50;150;100;myid1}}}

Output in Trace:
Position of the Checkmask that is violated

(masks).

Example:

CheckMask: Content is placed on the forbidden area [forbidden;0mm;0mm;150cm;100mm;myid01].

CheckMaskThreshold

String

Allows you to set a fault tolerance. The value specifies how many pixels in a "forbidden" check mask area are tolerated without causing an injury.

Integers can be specified:

Default: 1

StopOnFirstCheckmaskViolation

String

pecifies whether to abort at the first violation that occurs.

The violation is stored in the CheckmaskViolations property.

Possible values:

0: it is not aborted (default).

1: it is aborted.

StopAfterCheckmaskViolation

String

ecks the entire document and saves all violations in the property and returns an error message.

Possible values

0: no error message.

1: Error message and saving all violations