PDF compare

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Winki
Posts: 4
Joined: 2016-03-11T02:47:19-07:00
Authentication code: 1151

PDF compare

Post by Winki »

Hello
I just have to compare PDFs. This works fine with compare.exe as long as the PDFs are single sided. Is there a easy way to compare PDFs with two sides or do I have to split these PDFs in two single sided files?

Thanks in advance
Winki
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF compare

Post by snibgo »

I don't think you can do that with "compare". But with "convert, you can do this:

Code: Select all

convert first.pdf null: second.pdf -compose Difference -layers composite -format %[fx:mean]\n info:
This will do a pairwise comparison between the PDF files. If each has ten pages, you will get ten numbers between 0.0 and 1.0, where 0.0 means they are identical.
snibgo's IM pages: im.snibgo.com
Winki
Posts: 4
Joined: 2016-03-11T02:47:19-07:00
Authentication code: 1151

Re: PDF compare

Post by Winki »

Hi snibgo
thanks for your quick response.
I'm not really familiar with IM, so I copied your code 1:1 (only replaced filenames) and I get "Invalid parameter null:" from IM :-(
Did I do something wrong?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF compare

Post by snibgo »

What version of IM are you using? If older than about 6.9, I suggest you upgrade.
snibgo's IM pages: im.snibgo.com
Winki
Posts: 4
Joined: 2016-03-11T02:47:19-07:00
Authentication code: 1151

Re: PDF compare

Post by Winki »

Ok, seems I have version 6.8.4-9.
Unfortunately this is stored on a server and I'm not able to update.
So I think I have to split the Files ...
Winki
Posts: 4
Joined: 2016-03-11T02:47:19-07:00
Authentication code: 1151

Re: PDF compare

Post by Winki »

Hi snibgo, me again.
I tried your code once again on a other system where I have IM 6.9.1.
Here it works fine. So it's clear that the problem is the IM version on the server.

Thanks a lot
Winki

P.S.: Its my first Post on this forum. Should/can I mark it as solved?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF compare

Post by snibgo »

You can edit the title. Put [Solved] at the start.
snibgo's IM pages: im.snibgo.com
Post Reply