This inspired me to have Claude 3.5 Sonnet knock out a quick web page prototype for me, using PDF.js to load and render the PDFs to canvas elements and then display visual diffs between their pages. Two prompts: Build a tool where I can drag and drop on two PDF files and it uses PDF.js to turn each of their pages into canvas elements and then displays those pages side by side with a third image that highlights any di…
Diff-pdf: tool to visually compare two PDFs
61–70 of 85 posts
Re: Diff-pdf: tool to visually compare two PDFs
#62Related - this might be helpful to someone. ImageMagick can do a visual PDF compare: magick compare -density "$DENSITY" -background white "$1[0]" "$2[0]" "$TMP" (density = 100, $1 and $2 are the filenames to compare, $TMP the output file) You need to do some work to support multiple pages, so I use this script: https://gist.github.com/mbafford/7e6f3bef20fc220f68e467589bb... This also uses `imgcat` to show the differe…
Next level, especially with the git attribute calls, well played. I'm still blown away how powerful imagemagick is after using it for a decade or two, what an inspiring piece of open source software.
Re: Diff-pdf: tool to visually compare two PDFs
#63Re: Diff-pdf: tool to visually compare two PDFs
#64This inspired me to have Claude 3.5 Sonnet knock out a quick web page prototype for me, using PDF.js to load and render the PDFs to canvas elements and then display visual diffs between their pages. Two prompts: Build a tool where I can drag and drop on two PDF files and it uses PDF.js to turn each of their pages into canvas elements and then displays those pages side by side with a third image that highlights any di…
What’s the best way to effectively make use of Claude 3.5 ? I signed up a few days ago for the api access. Besides console.anthropic.com , do you recommend any other tools that I can run locally to give it api key and use claude effectively ?
For terminal access I like using my own https://llm.datasette.io/ tool with the https://github.com/simonw/llm-claude-3 plugin
For Python library access I recommend checking out Claudette: https://www.answer.ai/posts/2024-06-21-claudette.html
Re: Diff-pdf: tool to visually compare two PDFs
#65I 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!
could you not just compare the source (or perhaps even the hash) of the PDF and assert on that?
Re: Diff-pdf: tool to visually compare two PDFs
#66Earlier quoted context omitted.
could you not just compare the source (or perhaps even the hash) of the PDF and assert on that?
Hashes can change regularly due to metadata. Source checks may also require some filtration or preprocessing before comparison. Visual comparison is the best option here, especially if you have a complex document with multiple third-party components that may change both the hash and source but keep the visual appearance the same.
Re: Diff-pdf: tool to visually compare two PDFs
#67This inspired me to have Claude 3.5 Sonnet knock out a quick web page prototype for me, using PDF.js to load and render the PDFs to canvas elements and then display visual diffs between their pages. Two prompts: Build a tool where I can drag and drop on two PDF files and it uses PDF.js to turn each of their pages into canvas elements and then displays those pages side by side with a third image that highlights any di…
Re: Diff-pdf: tool to visually compare two PDFs
#68This inspired me to have Claude 3.5 Sonnet knock out a quick web page prototype for me, using PDF.js to load and render the PDFs to canvas elements and then display visual diffs between their pages. Two prompts: Build a tool where I can drag and drop on two PDF files and it uses PDF.js to turn each of their pages into canvas elements and then displays those pages side by side with a third image that highlights any di…
Re: Diff-pdf: tool to visually compare two PDFs
#69In a previous job, I had to validate the output of an unreliable production publishing system, so I tested dozens of PDF comparison tools available at the time. The best I found was called Delta Walker. It was proprietary commercial Mac-only software, but reasonably inexpensive, accurate, and could handle long PDFs with lots of graphics well. I remember evaluating this diff-pdf tool and finding that it fell short in…
Re: Diff-pdf: tool to visually compare two PDFs
#70I 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!
could you not just compare the source (or perhaps even the hash) of the PDF and assert on that?