# PDF compare using robot

**URL:** <https://forum.robotframework.org/t/pdf-compare-using-robot/6807>\
**Category:** Libraries\
**Created:** [9 February 2024 11:39 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807 "2024-02-09T11:39:33Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![omar1677](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omar1677](https://forum.robotframework.org/u/omar1677)\
**Post date:** [9 February 2024 11:39 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/1 "2024-02-09T11:39:33Z")

</div>

Hi Everyone.  
I am new in Robot and want to ask if there is a possibility to compare 2 PDFs with robot framework. Is there any existing library for doing this?  
Best Regards  
Omar

---

<div class="post-metadata">

**Author:** ![Pramesh](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@Pramesh](https://forum.robotframework.org/u/Pramesh)\
**Post date:** [9 February 2024 11:44 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/2 "2024-02-09T11:44:17Z")

</div>

Hi @omar1677,

There is a DocTest Library that can be used to compare pdf documents: [GitHub - manykarim/robotframework-doctestlibrary: Robot Framework DocTest library. Simple Automated Visual Document Testing.](https://github.com/manykarim/robotframework-doctestlibrary)

Here is the link to the keywords: [https://manykarim.github.io/robotframework-doctestlibrary/PdfTest.html](https://manykarim.github.io/robotframework-doctestlibrary/PdfTest.html)

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Many](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/many/32/658_2.png) [@Many](https://forum.robotframework.org/u/Many)\
**Post date:** [9 February 2024 11:47 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/3 "2024-02-09T11:47:39Z")

</div>

Also check out the keywords for the visual comparison of PDF documents:  
[https://manykarim.github.io/robotframework-doctestlibrary/VisualTest.html](https://manykarim.github.io/robotframework-doctestlibrary/VisualTest.html)

---

<div class="post-metadata">

**Author:** ![omar1677](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omar1677](https://forum.robotframework.org/u/omar1677)\
**Post date:** [12 February 2024 09:40 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/4 "2024-02-12T09:40:06Z")

</div>

Thanks a lot for your answer. I will try it 😉

---

<div class="post-metadata">

**Author:** ![omar1677](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omar1677](https://forum.robotframework.org/u/omar1677)\
**Post date:** [2 April 2024 10:56 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/5 "2024-04-02T10:56:42Z")

</div>

Hi Again,  
how can i install the library `VisualTest` ? robot show it red for me  
BR  
Omar

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [2 April 2024 11:03 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/6 "2024-04-02T11:03:59Z")

</div>

Many’s link points to: [GitHub - manykarim/robotframework-doctestlibrary: Robot Framework DocTest library. Simple Automated Visual Document Testing.](https://github.com/manykarim/robotframework-doctestlibrary)

On that page:

> Installation instructions  
> `pip install --upgrade robotframework-doctestlibrary`

And example usage:

```python
***Settings*** 
Library DocTest.VisualTest 
***Test Cases*** 
Compare two Images and highlight differences 
  Compare Images Reference.jpg Candidate.jpg

```

---

<div class="post-metadata">

**Author:** ![omar1677](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omar1677](https://forum.robotframework.org/u/omar1677)\
**Post date:** [2 April 2024 13:35 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/8 "2024-04-02T13:35:58Z")

</div>

yes it works. Thanks a lot.  
now i have another problem. The files must exists on windows but i want to compare files on Unix server. So after making an SSH connection, i go to a folder but robot can’t find the files i want to compare. any Idea how to solve this?  
BR  
Omar

---

<div class="post-metadata">

**Author:** ![Many](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/many/32/658_2.png) [@Many](https://forum.robotframework.org/u/Many)\
**Post date:** [3 April 2024 05:15 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/9 "2024-04-03T05:15:53Z")

</div>

You can use the ssh library to copy the files to a local directory first before comparing.  
[https://robotframework.org/SSHLibrary/SSHLibrary.html](https://robotframework.org/SSHLibrary/SSHLibrary.html)

---

<div class="post-metadata">

**Author:** ![shiwopotato](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/shiwopotato/32/3898_2.png) [@shiwopotato](https://forum.robotframework.org/u/shiwopotato)\
**Post date:** [29 July 2024 07:07 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/10 "2024-07-29T07:07:22Z")

</div>

Hello, my PDF files have multiple pages but I observed that it only compares the page 1. How can I make it compare all of the pages? I looked into the document but found none or maybe I missed something.

---

<div class="post-metadata">

**Author:** ![Many](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/many/32/658_2.png) [@Many](https://forum.robotframework.org/u/Many)\
**Post date:** [6 August 2024 12:59 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/11 "2024-08-06T12:59:15Z")

</div>

Is there already an error during the comparison of the first page?  
Are you using the `Compare Images` KW for a visual comparison?

---

<div class="post-metadata">

**Author:** ![Joy](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@Joy](https://forum.robotframework.org/u/Joy)\
**Post date:** [17 September 2024 10:07 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/12 "2024-09-17T10:07:43Z")

</div>

is there a way to solve this?

---

<div class="post-metadata">

**Author:** ![omar1677](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omar1677](https://forum.robotframework.org/u/omar1677)\
**Post date:** [11 October 2024 10:17 UTC](https://forum.robotframework.org/t/pdf-compare-using-robot/6807/13 "2024-10-11T10:17:06Z")

</div>

could you solve the problem?  
I use following key word : ‘Compare Pdf Documents’ and for me all pages are compared
