Visually Comparing Two PDFs Quickly

Ever wonder "in what creative way did I mess up this PDF but haven't noticed"?

12 May 2025

While I was preparing to submit my most recent manuscript, I had to quickly add line numbers. It just took a couple of lines in the LaTeX source file, but I was worried that doing so would subtley mess up the document in some way that I’d only realize after it was too late. To ensure that the two documents were identical but for the line numbers, I just overlayed them using pdftk and the following command:

pdftk new_file.pdf multibackground old_file.pdf output overlayed_file.pdf

That results in overlayed_file.pdf which contains… well.. the overlayed PDFs. In my case I was able to see that the documents were identical but for a couple of reflowed paragraphs, which were totally fine:

Screen shots of one paragraph from the old, new, and overlayed files.

Sharing is Caring