Skip to content

API Reference parrot.outputs.a2ui_renderers.pdf

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.outputs.a2ui_renderers.pdf

View source

PDF renderer (Module 5, satellite) — SPK-1 backend = weasyprint.

Closes the G5 static-delivery chain: envelope → baked SSR-HTML (TASK-1729) → static-SVG chart pre-render → weasyprint rasterization → RenderedArtifact (PDF) suitable as a send_notification email attachment.

SPK-1 (TASK-1722) confirmed weasyprint as the default for all static artifact classes (deterministic, no browser). weasyprint runs no JavaScript, so Chart components are pre-rendered to static SVG (deterministic data→SVG) before rasterization — no JS, no exec. No playwright path is shipped (SPK-1 did not require a per-class split).

Alias CreateSurface

Re-exported from parrot.outputs.a2ui.models.CreateSurface.

Class PDFRenderer

weasyprint-backed PDF renderer (SSR-HTML → static SVG charts → PDF).

Inherits :class:SSRHTMLRenderer's v1.0 dispatch/reconstruction wholesale (spec Scope: "hereda del SSR") — only _UNSUPPORTED is overridden so Video/AudioPlayer always degrade to a visible notice (weasyprint runs no JS/media playback), and render() additionally rasterizes the resulting HTML to PDF via weasyprint, with Chart components pre-rendered to static SVG first (weasyprint runs no JS, so Chart's lowered text-only form gets a visual alongside it).

Parameter Type Default Description
theme str 'light' Default theme name resolved by :class:~parrot.outputs.formats.assets.design_system.DesignSystem.

Attributes:

Attribute Type Description
PAGINATES bool

Method PDFRenderer.render

Render an envelope to a PDF RenderedArtifact (weasyprint).

render(envelope: CreateSurface, *, bake: bool = True, deep_links=None) -> RenderedArtifact

Parameter Type Default Description
envelope CreateSurface
bake bool True
deep_links None

Returns: RenderedArtifact

Alias RenderedArtifact

Re-exported from parrot.outputs.a2ui.artifacts.RenderedArtifact.

Alias RendererCapabilities

Re-exported from parrot.outputs.a2ui.renderers.RendererCapabilities.

Alias SSRHTMLRenderer

Re-exported from parrot.outputs.a2ui_renderers.ssr_html.SSRHTMLRenderer.

Alias bake_envelope

Re-exported from parrot.outputs.a2ui.baking.bake_envelope.

Attribute logger

Alias parrot

Re-exported from parrot.

Alias register_a2ui_renderer

Re-exported from parrot.outputs.a2ui.renderers.register_a2ui_renderer.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally