Situation
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?
Problem
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).
Solution
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!
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).
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
Hi, can you change your text?
this is barely readable:
pdftotext file1.pdf
pdftotext file2.pdf
kdiff3 file1.txt file2.txt
How about 12pt?
Well apparently binary diff of pdf files generated from .odt can differ. Do you have any ideas for this – http://stackoverflow.com/questions/2903774/reliable-and-fast-way-to-convert-a-zillion-odt-files-in-pdf ?
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!
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