report-to-pdf
Report To PDF
Use this skill only when the user explicitly needs a PDF from an existing Data Analytics report, dashboard, or inline chart surface. Prefer a static HTML export or static report file as the source. Do not rely on a live MCP app's direct in-frame print path; Codex MCP apps run in a sandboxed host that does not expose a supported print/PDF bridge.
The expected path is static HTML -> Chrome headless print-to-PDF -> PDF verification. If only a live MCP app report exists, create or retrieve the matching static HTML/export source first.
Workflow
-
Resolve the static source.
Use an absolute local path to a static HTML report/export or a local URL served from that static export. If the source is a live MCP app, blob stub, sign-in page, redirect page, incomplete viewer, or an app shell that contains boot scripts but not the report content, stop and obtain a static HTML/export source before continuing.
When the user provides a hosted artifact URL, first determine whether it exposes a usable static export or package source. If the static export is unavailable but the validated artifact payload is still available in the current run, create the matching static HTML/export from that payload and preserve source provenance in the handoff. If neither a static export nor the artifact payload is available, stop with a blocker instead of printing the live app shell or rebuilding the report from memory.
When creating or repairing the static source, keep visible metadata reader-facing. Do not copy internal artifact runtime fields, package plumbing, or validator/debug state into the report body, header, footer, or source section. For example, omit raw labels such as snapshot status, package path, widget type, manifest path, renderer IDs, validation status, and local temp paths from the visible PDF. If a runtime detail matters for audit or troubleshooting, preserve it in support notes rather than the visible PDF. Translate data-state caveats into reader language only when they affect interpretation, such as "synthetic demo data" or "partial source coverage."
-
Generate the PDF with Chrome CLI headless print-to-PDF.
Use the platform-specific Chrome executable available in the environment. Common examples are
/Applications/Google Chrome.app/Contents/MacOS/Google Chromeon macOS andgoogle-chrome,chromium, orchromium-browseron Linux. This is the primary conversion method because it prints the static HTML with a browser rendering engine and usually preserves selectable text, layout, charts, tables, and print CSS.