PDF modules

The technology-specific modules for PDF perform specific tasks for the PDF technology.

PDF 1:1 Compare

This module compares two PDF files.

The success of a test case depends on the similarity between two files:

  • If the similarity is above a certain percentage, the test case passes.

  • If the similarity is below a certain percentage, the test case fails.

You can specify the following values when you use this module:

Value

Description

Reference File

Full path to the first PDF file, including the file name and extension.

Reference File Password

Password to open the first PDF file.

Target File(s)

File(s) you want to compare to the Reference File.

Target File Password(s)

Password(s) for decrypting the Target File(s). To specify multiple passwords, use a semicolon (;) as a separator.

Moreover, note the following:

  • The number of passwords must match the number of PDF files you specify as Target File(s).

  • If you specify folder paths as Target File(s), the same password(s) applies to all PDF files within each specified folder.

Accuracy [%]

Minimum similarity in percent between the two files.

Comparison Type

Type of comparison that you want to perform:

  • Full Text Content: Compares the entire text content of the files at once, regardless of the text position in a page. Note that only well-formed text is used for the comparison, meaning OCR text recognition is not supported.

  • Page by Page Text: Compares the entire text content of the files, where each page is compared against its corresponding page in the other file(s).

  • Page by Page Image (default): Compares the visual content of the files, where each page is compared against its corresponding page in the other file(s).

Excluded Pages

Optionally, specify the pages that you want to exclude from the comparison.

To specify a page range, use a hyphen (-). To specify multiple pages or page ranges, use a semicolon (;).

Excluded Areas

Optionally, specify areas in your PDF files that you want to exclude from the comparison:

  • Area to Exclude > Dimensions contains the dimension coordinates respective to the excluded area.

  • Area to Exclude > Page(s) specifies in which pages of the document the excluded area is. To specify a page range, use a hyphen (-). To specify multiple pages or page ranges, use a semicolon (;).

Excluded Text

Optionally, specify patterns of text that you wish to exclude from the comparison. You can use regular expressions to specify unique patterns, if needed. We recommend you use Regular Expressions 101 (opens in new tab) to verify your regular expressions:

  • Pattern to Exclude > Pattern contains the text pattern you want to exclude. If you use special characters in this pattern but intend to use them as ordinary characters, you have to escape them.

  • Pattern to Exclude > Use Regex specifies whether the Pattern to exclude contains regular expressions.

In this example, Tosca Cloud compares the text contents of the file ReferencePDF.pdf with the files Target_A.pdf and Target_B.pdf.

  • You expect that the files should be at least 80 percent similar.

  • You exclude page 1 and pages 3 to 4 from the comparison.

Compare two PDF files

Check PDF for Broken Links

This module checks for any links in a PDF file that return client error responses (400-499) or server error responses (500-599). This helps you verify whether there are broken links inside a document. You can specify the following values when you use this module:

Value

Description

PDF File

Complete path to the PDF file you want to verify.

Example: C:\MyReports\YearlyReport.pdf.

Ignore Errors

Error code you want to ignore in your test.

For example, enter 403 to ignore all links with a "Forbidden" response.

In this example, Tosca Cloud checks TestPDF.pdf for broken links. It checks for all error types except 403 errors.

Check for error responses

You can find the list of broken links under Log info in Results:

Link verification test results

Barcode Reader

This module lets you verify or buffer the values of the following barcodes and QR codes in PDF files:

  • For barcodes: Code 39, Code 93, Code 128, EAN-8, EAN-13, UPC-A, UPC-E, ITF, Industrial 2 of 5, Inverted 2 of 5, IATA, Add 2, Add 5, Matrix 2 of 5, Datalogic 2 of 5, Codabar, BCD Matrix.

  • For QR codes: QR, Micro QR, Data Matrix, PDF417, Aztec.

You can specify the following values when you use this module:

Value

Description

PDF File

Absolute path to the PDF file.

Barcode - Type

Type of barcode you want to scan:

  • All: Check for any supported barcode. This option requires additional processing and may impact on performance.

  • Barcode: Check for barcodes only.

  • QR: Check for QR codes only.

Barcode - Page

Optionally, specify which pages you want to check for barcodes or QR codes. If you leave this blank, Tosca Cloud checks all pages.

Barcode - Index

Optionally, specify the index of the barcode or QR code, to narrow down your matches.

Enter one of these values:

  • A number to indicate the <n>th barcode or QR code based in your file. You can enter any positive integer.

  • first to specify the first barcode or QR code in your file.

  • last to specify the last barcode or QR code in your file.

Barcode - Value

Specify the action you want to perform:

Extract Links

This module lets you extract and buffer links inside a PDF file into an array. You can then use your buffered links in other test steps. Tosca Cloud automatically finds all the links, so there's no need to scan the PDF file. You can specify the following values when you use this module:

Value

Description

PDF File

Absolute path to the PDF file.

Barcode - Type

Type of barcode you want to scan:

  • All: Check for any supported barcode. This option requires additional processing and may impact on performance.

  • Barcode: Check for barcodes only.

  • QR: Check for QR codes only.

Barcode - Page

Optionally, specify which pages you want to check for barcodes or QR codes. If you leave this blank, Tosca Cloud checks all pages.

Barcode - Index

Optionally, specify the index of the barcode or QR code, to narrow down your matches.

Enter one of these values:

  • A number to indicate the <n>th barcode or QR code based in your file. You can enter any positive integer.

  • first to specify the first barcode or QR code in your file.

  • last to specify the last barcode or QR code in your file.

Barcode - Value

Specify the action you want to perform: