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 » 2016-03-11T02:57:14-07:00

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: 12011
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF compare

Post by snibgo » 2016-03-11T03:28:35-07:00

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 » 2016-03-11T04:23:16-07:00

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: 12011
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF compare

Post by snibgo » 2016-03-11T04:29:18-07:00

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 » 2016-03-11T04:37:28-07:00

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 » 2016-03-11T04:48:38-07:00

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: 12011
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: PDF compare

Post by snibgo » 2016-03-11T05:04:04-07:00

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

Post Reply