QTK.Content
The assembly QTK.Content.dll contains document content related functions and tests. Most of these functions only can be executed within the Monitor, therefore the host
attribute should be set to local
.
DocumentContentExportExecuter
Stupka.QTK.Content.DocumentContentExportExecuter (QTK.Content.dll)
Exports the textual representation of a document to the filesystem. The document has to be selected first, e.g. using the DocumentFromFileSelector
.
Properties
Name | Type | Required | Description |
---|---|---|---|
document | xsd:IDREF | Yes | Reference to a pre-selected document. Currently only PDF documents are supported. |
filename | xsd:string | Yes | Absolute or relative filename. If a relative filename is specified, the export is created relative to the working directiry, either of the Monitor or the Agent. Use the token {0} for page number substitution. |
pages | xsd:string | Specify the pages from which the text shall be exported. You can specify multiple pages or ranges of pages, e.g. '1-5;7;9;12-15'. If not specified, all pages are used. |
DocumentContentSortedTest
Stupka.QTK.Content.DocumentContentSortedTest (QTK.Content.dll)
Tests a document for multiple texts in the specified order.
Properties
Name | Type | Required | Description |
---|---|---|---|
content | xsd:IDREF | Yes | Reference to a recordset holding the definition. |
document | xsd:IDREF | Yes | Reference to a document. Currently only PDF documents are supported. |
pages | xsd:string | Specify the pages where the texts shall be searched. You can specify multiple pages or ranges of pages, e.g. '1-5;7;9;12-15'. If not specified, all pages are used. |
Usage
For this test a recordset is required, which holds the expected information in correct order. The recordset has to provide one column named 'text' which holds the information to be searched.
DocumentContentTest
Stupka.QTK.Content.DocumentContentTest (QTK.Content.dll)
Tests a document for multiple texts.
Info
This test accepts text or pdf documents.
If you want to test content using regular expressions, its good practice to first export the document using the DocumentContentExportExecutor
and develop the regular expressions with any free regex debugger like https://regex101.com/.
Properties
Name | Type | Required | Description |
---|---|---|---|
content | xsd:IDREF | Yes | Reference to a recordset holding the definition. |
document | xsd:IDREF | Yes | Reference to a document. Currently only PDF documents are supported. |
Usage
For this test a recordset is required, which holds the expected information. The recordset has to provide the following columns.
Column | Description |
---|---|
text | Required. Text to be searched (case sensitive). |
regex | Optional. Set to "1" or "x" if the text shall be interpreted as regular expresion. |
pages | Optional. Specify the pages where the text shall be searched. You can specify multiple pages or ranges of pages, e.g. '1-5;7;9;12-15'. If not specified, all pages are used. |
mode | Optional. If not specified the text is expected on all pages. Set to 'any' if one match is sufficient. |
DocumentExportExecuter
Stupka.QTK.Content.DocumentExportExecuter (QTK.Content.dll)
Exports the specified document to the filesystem. The document has to be selected first, e.g. using the DocumentFromFileSelector
.
Properties
Name | Type | Required | Description |
---|---|---|---|
document | xsd:IDREF | Yes | Reference to a pre-selected document. |
filename | xsd:string | Yes | Absolute or relative filename. If a relative filename is specified, the export is created relative to the working directiry, either of the Monitor or the Agent. |
DocumentFromFileSelector
Stupka.QTK.Content.DocumentFromFileSelector (QTK.Content.dll)
Selects a document from the filesystem.
Properties
Name | Type | Required | Description |
---|---|---|---|
filename | xsd:string | Yes | Absolute or relative filename. If a relative filename is specified, the document is loaded relative to the working directiry, either of the Monitor or the Agent. |
DocumentFromResourceSelector
Stupka.QTK.Content.DocumentFromResourceSelector (QTK.Content.dll)
Selects a document from a specified resource.
Properties
Name | Type | Required | Description |
---|---|---|---|
resource | xsd:string | Yes | Name of the resource holding the document. |
DocumentPageCountTest
Stupka.QTK.Content.DocumentPageCountTest (QTK.Content.dll)
Tests if a document has the correct page count.
Properties
Name | Type | Required | Description |
---|---|---|---|
document | xsd:IDREF | Yes | Reference to a document. Currently only PDF documents are supported. |
pagecount | xsd:integer | Yes | Expected number of pages. |
DocumentPixelTest
Stupka.QTK.Content.DocumentPixelTest (QTK.Content.dll)
Tests if a document matches a reference document. The test itself is executed pixel-wise with an optional tolerance.
Info
For each page a delta image file is computed. To access these files, export the results to the filesystem.
Properties
Name | Type | Required | Description |
---|---|---|---|
area | xsd:string | Optiponal specification of an area of interest in format X,Y,Width,Height. The values itself are expected in millimeters relative to the upper left corner. | |
document | xsd:IDREF | Yes | Reference to a document. Currently only PDF documents are supported. |
pages | xsd:string | Specify the pages where the texts shall be searched. You can specify multiple pages or ranges of pages, e.g. '1-5;7;9;12-15'. If not specified, all pages are used. | |
parameters | xsd:string | Optional parameter to specify the internal image processing behaviour, see section Usage for details. If not specified, a moderate tolerance is applied. | |
reference | xsd:IDREF | Yes | Reference to a reference document. Currently only PDF documents are supported. |
resolution | xsd:integer | Resultion (dots per inch = dpi) of the extracted image. If not specified, the image is extracted with 72dpi. A value of 150 results in a better output image, but the test takes longer and consumes more memory. |
Usage
This test allows the pixel wise test of a document against a reference. If your documents do not match exactly, a certain tolerance can be specified using the Parameters
. This is a string value which contains all different parameter values.
Behaviour | Parameters |
---|---|
width | Width of internal gauss filter algorithm. |
sigma | Sigma of internal gauss filter algorithm. |
tolerance | Accepted difference between two pixels in range 0 to 255. |
threshold | Relevant pixel threshold in range 0 to 255. |
These parameters are best determined in try and error fashion as they are specifiy to the type of the document. Use the combinations below as staring point.
Behaviour | Parameters |
---|---|
exact | width=0;threshold=250;tolerance=5 |
tolerance [150dpi] | width=3;sigma=5;threshold=250;tolerance=30 |
tolerance [default] | width=2;sigma=5;threshold=250;tolerance=40 |