Pdf diff ?


Your exchanging pdf files with an editor for a journal publication. Each time you send a list of modifications to be applied and the modified pdf file comes back to you, usually with some additional modifications that you didn’t ask for. How to spot these change easily and to make sure they are relevant?


The solution that come to mind is to use a pdf diff tool, similar to what you usually use for text files or source code: diff, diff3, kdiff3, meld are such examples. However, a quick search on the internet couldn’t reveal any tool fulfilling the conditions (being free and open source are mandatory conditions).


The easy trick is to first convert these pdf to text file and then use the usual text comparison programs:

pdftotext file1.pdf
pdftotext file2.pdf
kdiff3 file1.txt file2.txt

and that’s it, you are now able to see what has been modified between the two files. Don’t count on that to be able to make a merge though!

6 thoughts on “Pdf diff ?

  1. Or even better in your .vimrc:

    autocmd BufReadPre *.pdf set ro
    autocmd BufReadPre *.pdf set hlsearch!
    autocmd BufReadPost *.pdf silent %!pdftotext -layout -nopgbrk “%” – |fmt -csw78

    It saves you from the two extra steps (manual pdftotext).

  2. Thanks that’s a nice one for the VI aficionados!
    For those who want to try this, just be careful when copying the “%”.
    Next, you can try calling
    vimdiff file1.pdf file2.pdf

  3. Hi, can you change your text?
    this is barely readable:

    pdftotext file1.pdf
    pdftotext file2.pdf
    kdiff3 file1.txt file2.txt

    How about 12pt?

  4. Use the google doc API, upload all the odt and download all the pdf: that’s processing on the cloud 😉
    Never tried, but seems possible!

  5. Even better solution: use pdiff (for mac) to see all diffs highlighted in the pdfs. Much easier to track all changes in the actual layout than in plain text output of pdftotext. Saved me a lot of trouble! Ed

Leave a Reply

Your email address will not be published. Required fields are marked *