Skip to content

feat: open PDFs in tabs and check their signatures, through a MuPDF helper - #123

Merged
FPurchess merged 43 commits into
feat/signingfrom
feat/pdf-tab
Oct 13, 2026
Merged

FPurchess merged 43 commits into
feat/signingfrom
feat/pdf-tab

Conversation

@FPurchess

@FPurchess FPurchess commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Open PDFs in tabs and check their signatures. Stacked on #122 (feat/signing); 3b (#124) builds on it.

What users get

  • PDF tabs:
    • Open a .pdf like any file. Its pages show read-only, with zoom, Print and the main menu. What doesn't apply to PDFs is greyed out, with the reason.
    • Tabs come back after a restart. Blank says when a PDF's file changed or went away, and offers Open again.
  • Signatures: a status item in the bottom bar: Not signed · Signed / Signed by 2 · Signed, signer unknown · Changed after signing · Signature invalid.
    • Clicking it opens the list of signatures. Details… shows the certificate, with Trust this certificate… and its fingerprint to compare.
    • "Valid" means your own certificate or one you trusted. For other certificates Blank says it doesn't check certificate authorities.
    • SHA-1 signatures are called weak, and revocation isn't checked.
  • view.signatures has no default key; it can be bound in Settings.

How it works

  • The PDF helper: a sidecar blank-pdf built from MuPDF 1.28.5 (vendored mupdf-sys; AGPL, compatible with Blank's AGPL-3.0-only), one helper per tab.
    • It talks over a versioned protocol on stdin/stdout. Each request has a timeout and an answer limit.
    • On Linux and macOS it has a memory limit. It is restarted once after a crash; after that the tab shows its error.
    • It sits behind one PdfEngine trait, so another renderer could replace MuPDF.
  • Shipping:
    • The helper ships as bundle.externalBin; on Linux it's installed in /usr/lib/blank.
    • MuPDF's sources and the built helper are cached in CI (.github/actions/mupdf). Intel Macs are cross-built on PRs.
    • The C libraries inside MuPDF are listed in the third-party notices and checked.
  • Checking: the signer's own code (verify) checks signatures. It guards against signature-wrapping and incremental-saving attacks, and caps the form walk.
  • Rules and docs: .claude/rules/pdf.md, docs/guide/pdf.md, and the FAQ, files, install, menu, print and shortcuts pages. CONTRIBUTING explains the helper's build on a fresh machine.
  • E2E: e2e/specs/pdf.e2e.ts covers opening a PDF, zoom, the signature status and Open again.

First runs on CI

  • The MuPDF builds on macOS (both architectures) and Windows, and the glibc floor check of the helper, have only run here on Linux. This PR's CI is their first run.

Checked by hand

  • Linux: open, zoom, print, signatures, restart, a changed or deleted file; a keyboard-only play-through
  • macOS 12 and Windows: the helper starts, and the app is signed/notarized with it
  • Snap and AppImage find the helper in /usr/lib/blank
  • A screen reader; the KDE print portal

… PDF tabs, and say what the signature check found
…what they and the client send each other, and take a signature's timestamp only from a token that holds
…gned again later, unchecked timestamps, weak SHA-1, timestamps required when asked
…o compare, and document the signature check's new fields
…cus, the Sign dialog shows the date and the server, and says how the PDF was signed
… PDF, show a PDF without pages as damaged, and name Save's real key after a Word import
…fter Close tab, and grey out what can't change a PDF, from the keyboard play-through
…F that opens while a certificate is trusted, and check a PDF's signatures once per show
# Conflicts:
#	.claude/rules/state.md
#	CLAUDE.md
#	scripts/build-notices.ts
#	src-tauri/Cargo.toml
#	src/editor/requests.ts
#	src/importers/docx/signatures.ts
@FPurchess
FPurchess merged commit e887601 into main Oct 13, 2026
9 checks passed
@FPurchess
FPurchess deleted the feat/pdf-tab branch October 13, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant