view_page: draw the printed page under the ink on PDF and EPUB pages #105
Loading…
Reference in a new issue
No description provided.
Delete branch "feat-100-view-page-pdf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
view_page now composites the pdftoppm-rasterized PDF page under the ink, placed like the web viewer (fit by aspect ratio, centered, from the top); OCR stays ink-only. Proven by a red-then-green MCP test checking printed-text and ink pixels, a blank-PDF-page case and a missing-PDF fallback, plus the full suite and green CI.
Fixes #100
Red, then green
bash -lc 'eval "$(mise activate bash --shims)"; mix test test/rm_analyzer_web/notes_mcp_agent_test.exs'38202c1): exit 11ac56d4): exit 0Checks
bash -lc 'eval "$(mise activate bash --shims)"; mix test && curl -sf -H "Authorization: token $FORGEJO_TOKEN" https://git.knope.dev/api/v1/repos/jfro/rm-analyzer/commits/1ac56d4/status | jq -e ".state == \"success\""', exit 0bash -lc 'cd /home/peak/work/rm-analyzer-plan-review-loop/rm-analyzer && eval "$(mise activate bash --shims)"; mix test test/rm_analyzer_web/notes_mcp_agent_test.exs', exit 0Risks
Only checked against the 225x150 pt fixture on older-firmware (scaled) pages; not yet tried on a real Paper Pro page with a recorded paper size or a rotated PDF, though the placement math matches the web viewer. Each view_page on a PDF page now runs pdfinfo, pdftoppm and rsvg-convert (not cached), so it's slower than the ink-only render.
Prover
Passed (Sonnet): Read the diff: placement math matches Scene.fit_pdf and the web viewer, OCR path untouched, missing-PDF/pdftoppm/blank-page fallbacks sound; format clean, MCP tests and full suite (1595) pass. Untested: real Paper Pro page, rotated PDFs, performance on large PDFs.
Every command above was run by Fortysix's Basecamp itself, on the branch named.