feat(compare): add PDF file comparison support#63
Merged
MrFlounder merged 1 commit intomainfrom Mar 14, 2026
Merged
Conversation
Extract text from PDFs using pdftotext before diffing, enabling side-by-side comparison of PDF documents in the browser viewer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
MrFlounder
added a commit
that referenced
this pull request
Mar 14, 2026
## Summary - Adds `compare_ensure_poppler` helper that auto-installs poppler when missing (brew/apt/dnf) - Runs during first-time asset setup (`compare_ensure_assets`) so PDF comparison works out of the box - Also runs on `crab compare --update-assets` to ensure poppler is present - Falls back to a manual install message if no supported package manager is found Follow-up to #63. ## Test plan - [ ] On a machine without poppler: `crab compare file1.pdf file2.pdf` — auto-installs poppler then compares - [ ] `crab compare --update-assets` — re-downloads assets and ensures poppler is installed - [ ] On a machine with poppler already installed — skips install silently 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crab compareby extracting text viapdftotext(poppler) before diffing.pdfextensions (case-insensitive) and auto-extracts text with layout preservationpdftotextis missing (brew/apt/dnf)Test plan
crab compare file1.pdf file2.pdf— opens diff in browser with extracted textcrab compare file.pdf file.txt— shows error about mismatched typescrab compare file1.txt file2.txt— still works as before (no regression)pdftotextinstalled — shows install instructions🤖 Generated with Claude Code