PDF Modules

The folder TBox XEngines->Pdf in the Standard subset contains a Module that performs specific tasks for the PDF Engine 3.0.

1:1 Compare

The Module 1:1 Compare allows you to compare two PDF files.

The PDF Engine 3.0 performs a visual comparison between the two files.

  • If the similarity between the two files is above a certain percentage, the TestCase passes.

  • If the similarity between the two files is below the expected value, the TestCase fails.

The Module has the following ModuleAttributes:

ModuleAttribute

Description

Reference PDF

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

Reference PDF Password

Password to open the first PDF file.

Target PDF

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

Target PDF Password

Password to open the second PDF file.

Accuracy [%]

Specify the minimum similarity in percent between the two files.

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 (;).

In this example, you compare the file base.pdf to the file target.pdf.

You specify the password for each file.

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

You exclude page 2 and pages 5 to 8 from the comparison.

Compare two PDF files

The comparison result shows that the files don't have the minimum similarity that you have specified.

Consequently, your TestCase fails.

Failed PDF comparison