Does anyone know how to compare two pdf files using adobe acrobat through command line. I want to do this via command line because we want to compare hundreds of file every day through some automated windows tasks.
Any kind of help will be greatly. I do not want to limit myself to acrobat to compare , if there is something else available.
You can use the Compare Documents tool to find differences between two versions of PDF files. After comparing two files, Acrobat provides a detailed report of every change, including text, fonts, images, and even the order of the pages. Choose Tools > Compare Documents. Choose the documents to compare.
The Compare Documents feature is located in the Review tab: The Compare Documents dialog box will open. Select the documents you want to compare, and click OK: When the comparison is complete the Compare Result dialog box will open and display the results.
Open a pdf file and right-click any area in the tab > Select 'Split View'. Open a pdf file and click 'View' on the main menu > Select 'Split View'. Open the files in two tabs and click the area between the tabs.
What you want simply cannot be done with Adobe Acrobat through the command line. However, you could do it with the help of some commandline utilities which you could unite into a shell or batch script.
One ingredient of this would be ImageMagick's convert
command, which you can test like this for two 1-page PDF files which have page contents similar to each other's:
convert -label '%f' -density '100' first.pdf second.pdf -scale '100%' miff:- \
| montage - -geometry +0+0 -tile 1x1 -background white miff:- \
| animate -delay '50' -dispose background -loop 0 -
This will open a window which switches with a delay of 50 dezi-seconds between displaying each of the two files, so it is easy to discover visual differences.
I'm doing the same thing using a shell script on Linux that wraps
compare
commandpdftk
utility(It would be rather easy to port this to a .bat
Batch file for DOS/Windows.)
You can read details about this approach in this answer.
How about i-net PDFC - it does a full content comparison - text, images, lines, header/footer-detection and so on. You can use it either on command line or with a GUI (2.0, currently in public beta-phase).
The command-line tool already has the option to compare folders with PDFs against each other (or the extreme way: use the API ;))
Disclaimer: Yep, I work for the company who made this - so feedback highly appreciated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With