Skip to content

Compare Two PDF Files Function: pdfcompare

The Compare Two PDF Files function is used to compare the text content of two PDF files. It checks whether the text in both files is identical and returns a Boolean value:

  • true – if the text in both PDF files is the same.
  • false – if there are any differences in the text content.

The comparison result is stored in a variable defined in the Element Key field, which can be used in subsequent steps of the automation workflow.

Example: You need to compare two versions of a contract document, Contract_V1.pdf and Contract_V2.pdf, stored in the folder C:\User\Documents\, to verify if any modifications have been made.

Steps to Configure:

  1. Add a new step to the automation workflow.
  2. Select Set a Variable Value from the Action dropdown.
  3. Enter a variable name in Element Key (e.g., ComparisonResult). This variable will store the comparison outcome (true or false).
  4. Click on Form, select Functions, and choose Compare Two PDF Files.
  5. Provide the following parameters:
    • FirstPdfFilePath: Specify the full path of the first PDF file (e.g., C:\User\Documents\Contract_V1.pdf).
    • SecondPdfFilePath: Specify the full path of the second PDF file (e.g., C:\User\Documents\Contract_V2.pdf).
  6. Click Save.

Note: While the steps for adding an Action are identical in both views, the display of the steps changes:

scrn-compare-pdf-files-tabular-view
Tabular View
scrn-compare-pdf-files-card-view
Card View

Outcome on Execution:

  • If Contract_V1.pdf and Contract_V2.pdf contain identical text, the variable ComparisonResult will store true.
  • If there are any differences in the text content, ComparisonResult will store false.
  • You can use this result using the syntax ${ComparisonResult} in conditional workflows, such as triggering an alert if discrepancies are found.

Back To Top