Behaviour + facade for PDF rendering (PDF-01, D-32).
Callers pass pre-rendered HTML + opts; the adapter returns a binary PDF body. Two adapters ship with Phase 1:
Accrue.PDF.ChromicPDF— production default. Delegates to the host application's ChromicPDF instance. Accrue does NOT start ChromicPDF (D-33, Pitfall #4) — the host app starts it in its own supervision tree.Accrue.PDF.Test— Chrome-free test adapter. Sends{:pdf_rendered, html, opts}toself()and returns{:ok, "%PDF-TEST"}(D-34). Use in tests to avoid Chrome binary dependency.
Telemetry (T-PDF-01)
[:accrue, :pdf, :render, :start | :stop | :exception] is emitted with
metadata %{size, archival, adapter}. The HTML body is NEVER placed in
metadata — it may contain PII.
Summary
Functions
Renders html to a PDF binary via the configured adapter.
Types
Callbacks
Functions
Renders html to a PDF binary via the configured adapter.
Options
:size— paper size (atom or tuple, adapter-specific). Default:a4.:archival— whentrue, produces PDF/A (long-term archival format). ChromicPDF usesprint_to_pdfa/1in this case.:header_html,:footer_html— optional header/footer HTML. The ChromicPDF adapter translates these to the:header/:footerkeys thatChromicPDF.Template.source_and_options/1expects (RESEARCH Summary point 5).