Skip to content

docs(adr): record PDF library choice (mutool over hexapdf/origami)#52

Open
ronaldtse wants to merge 1 commit into
mainfrom
docs/adr-pdf-library-choice
Open

docs(adr): record PDF library choice (mutool over hexapdf/origami)#52
ronaldtse wants to merge 1 commit into
mainfrom
docs/adr-pdf-library-choice

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

  • Establishes docs/adr/ as the home for Architecture Decision Records (Nygard template)
  • Records ADR-0001: PDF library choice — mutool over hexapdf/origami
  • Adds a cross-reference in docs/architecture.md so the ADR is discoverable

Why

The mutool dependency was challenged during a recent investigation (REQ-code-chart-svg-extraction.md). Three alternatives were evaluated:

  • hexapdf — technically superior but AGPL-3.0/commercial; license-incompatible with ucode's BSD-2-Clause gemspec.
  • origami — LGPL-3.0+ (license-compatible) but has # TODO: Type0 and CID Fonts literally in source at font.rb:101, broken on Ruby 3.0+ (removed keyword-arg-to-Hash syntax), abandoned upstream (last commit Jan 2019).
  • Other Ruby PDF libraries — no Type0/CIDFont coverage.

The mutool path stays. Recording the reasoning in an ADR prevents the next contributor from re-spiking the same alternatives.

Test plan

  • ADR follows the standard Nygard template (Status / Context / Decision / Consequences)
  • Cross-reference added to docs/architecture.md#references
  • README.md in docs/adr/ explains the format and indexes the records

Establishes docs/adr/ as the home for Architecture Decision Records,
and captures the mutool-vs-alternatives decision so future explorers
don't re-spike it.

The decision was reached after a full investigation prompted by the
proposed switch to a pure-Ruby PDF library:

- hexapdf: technically superior to mutool but AGPL-3.0 / commercial
  — incompatible with ucode's BSD-2-Clause gemspec.
- origami: LGPL-3.0+ (compatible), but source has the literal
  comment "TODO: Type0 and CID Fonts" at font.rb:101, broken on
  Ruby 3.0+ (Hash.new keyword-arg syntax removed in 3.0), and
  abandoned upstream (last commit January 2019).
- Other Ruby PDF libraries (pdf-reader, prawn, combine_pdf) target
  different use cases and lack Type0/CIDFont support.

mutool stays. The shell boundary stays isolated through the existing
Glyphs::EmbeddedFonts::Catalog and PageRenderer classes; the rest
of the codebase never shells out directly.
@github-actions

Copy link
Copy Markdown

🔗 Link Check Failed

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