Python Forum

Full Version: How to compare two PDFs for differences
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I receive two PDFs daily from two different sources. Theoretically they're supposed to have the exact same numbers - but I would like to create an automated report which confirms this and notifies me of any issues.

Unfortunately, certain 'titles' within the reports differ ever so slightly, which makes recognition on this basis difficult.

For example, they may have the same balances, but one might be called "duck USD" while the other just called "duck" (example names).

Bearing in mind I'm relatively new when it comes to Python, what road could I go down in order to create this automation?




To give an example of the style of layout:

Report 1
Dog 50 2,000 5,000
Cat 80 5,000 10,000

Report 2
Dog USD 50 2,000 5,000
Cat EUR 80 5,000 10,000
Can you explain more what you want to do?
This has a pdf to text function:
https://pypi.org/project/pdf/
I would convert to txt and run a system file compare (until I learn to use the python functions for that!)

Better is this:
https://pypi.org/project/pdf-diff3/
Which will display the diff in a png image.