Diff-pdf: tool to visually compare two PDFs

(github.com)

150 points | by Olshansky 2 days ago

11 comments

  • thibaut_barrere 2 days ago
    I have been using this in a CI pipeline to maintain a business-critical PDF generation (healthcare) app (started circa 2010 I think), here is the RSpec helpers I'm using:

    https://gist.github.com/thbar/d1ce2afef68bf6089aeae8d9ddc05d...

    The code contains git-stored reference PDFs, and the test suite re-generate them and assert that nothing has changed.

    Helped a lot to audit visual changes, or PDF library upgrades!

  • smartmic 2 days ago
    I like this tool better: https://www.qtrac.eu/diffpdf.html

    It shows the differences in the GUI side-by-side instead of overlayed.

  • akasakahakada 2 days ago
    Use this to compare university textbook edition 8 and 9 before buying.
  • jaustin 2 days ago
    We've been using this in the Micro:bit Educational Foundation (microbit.org) to fill a gap in hardware design tooling, and get visual diffs of our schematics and gerbers during PCB design iterations. It's kinda wild that's what we ended up doing, but if you want to be sure your radio layout didn't change at all when you're making a minor revision to a different part of the board, visual diffs are perfect.

    That said, next project we want to try something more integrated with EDA tools. If anyone else has followed this path, we'd love to know.

  • poidos 2 days ago
    Reminds me of the tool Bob Nystrom wrote to help himself out when working on the physical edition of Crafting Interpreters: https://journal.stuffwithstuff.com/2020/04/05/crafting-craft...

    Whole article is worth reading, but if you want the relevant bits search for “ I wrote a Dart script that would take a PDF of the book”.

  • rawbert 2 days ago
    We use this tool in our team regularly for comparison of PDFs we obtain from third party services that might have changed after code-changes on our side. Big thanks to the author <3
  • canistel 2 days ago
    Interestingly, Github thinks the project is 46% shell, due to the fairly huge wxwin.m4.
    • infecto 2 days ago
      I noticed this a while back with a private project of mine. The Github languages breakdown seems broken. Mine is a Python project with a handful of Jupyter notebooks but many many python files. The LOC must be 80% python files but Github sees the project as 50% Jupyter.
  • Levitating 2 days ago
    No screenshots?
  • jgalt212 2 days ago
    Thanks. I'll give this a shot to see if any counterparties try to sneak in any last second changes to the executable version of the doc.
  • moxli 2 days ago
    Test
  • asah 2 days ago
    Crazy, I'd have thought that modern multi-modal LLMs can do this, but when I tried Gemini, ChatGPT-4o and Claude they all pooped out:

    - Gemini at first only diff'd the text, and then when pushed it identified the items in the images and then hallucinated the differences between the versions. It could not produce an image output.

    - Claude only diff'd the text and refused to believe that there images in the PDFs.

    - ChatGPT attempted to write and execute python code for this, which errored out.

    • infecto 2 days ago
      This is definitely not a strength for multi-modal LLM. Multi-modal capabilities are still too flaky especially when looking at a page of a PDF which can have multiple areas of focus.