# Compare PDFs

The Compare PDFs action in the Avo Assure is found under the **@Generic Element** is used to compare two provided PDF files. The results of this comparison highlight the differences or similarities between the files and save the result in dynamic variable.

### **Syntax**

**Input:** `<PDF_file_path1>;<PDF_file_path2>;<selective/all(optional)>;<pagewise/complete(Optional)>`&#x20;

{% hint style="warning" %}
**Note:**

* **Selective/all:** By default, the final argument is set to ‘all,’ which stores the entire file's content in the dynamic variable. If changed to ‘selective’ only specific parts of the file will be stored in the dynamic variable.
* **pagewise:** When the user selects ‘pagewise’ as the last argument, the comparison will be performed page by page (e.g., page 1 of PDF1 will be compared with page 1 of PDF2, page 2 of PDF 1 will be compared with page 2 of PDF2). By default, the last argument in the syntax will be set to ‘pagewise.’
* **complete:** when the user selects ‘complete’ as the last argument, the comparison .*This specifies that the comparison must be done with all pages (page 1 of PDF1 must be compared with all pages of PDF2, page 2 of PDF1 must be compared with all pages of PDF2, and so on)*

&#x20;
{% endhint %}

| Argument                                  | Description                                                                                                                                                |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<PDF\_file\_path1><br>(Required)</p>  | Specify the first PDF file path to compare.                                                                                                                |
| <p>\<PDF\_file\_path2><br>(Required)</p>  | Specify the second PDF file path to compare with first PDF file                                                                                            |
| <p>\<selective/all><br>(Optional)</p>     | <p>Optional extraction mode:<br>• all – stores entire file content in dynamic variable<br>• selective – stores only specific parts in dynamic variable</p> |
| <p>\<pagewise/complete><br>(Optional)</p> | <p>Optional comparison mode:<br>• pagewise – compares pages one-to-one (default)<br>• complete – compares each page of PDF1 with all pages of PDF2</p>     |

{% hint style="warning" %}
**Note**:

* Table content within PDFs is not supported, it might show inconsistencies in result.
* Empty pages or text not supported in compare PDFs.
* &#x20;Indicates any page-specific comparison results, if available.
* Modification appear as follows:

1\.     Added content is displayed as ||++\<content>++||

2\.    Deleted content is displayed as ||--\<content>--||
{% endhint %}

**Output Value**

| Argument                                 | Description                                                             |
| ---------------------------------------- | ----------------------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p> | This variable holds the comparison result (e.g., added/deleted content) |
| <p>\<Dynamic Variable><br>(Optional)</p> | This variable stores the status as **True** or **False**                |

**Example**

**Performs content comparison between two PDF documents using the selected mode**

The **Compare PDFs** action takes the value from the Input Value column (e.g., **C:\Docs\original.pdf;C:\Docs\updated.pdf;all;pagewise**) and compares the content of the specified PDF files based on the chosen comparison type. The result of the comparison operation is stored in the **{Compare}** variable, while the execution status is stored in the **{Status}** variable, with the following possible values:

* **True** – if the PDFs are compared successfully.
* **False** – if the PDFs differ or if an error occurs during comparison.

<figure><img src="/files/UHMaKXx7DvIV4ZH8CVFT" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Note:** After executing the Test Steps you can see the result in the Avo Assure Client console.
{% endhint %}

<figure><img src="/files/dq3oXU5yawCXhL5tcsID" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/file-and-folder-operations/compare-pdfs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
