Skip to content

API Reference parrot_formdesigner.renderers.pdf

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

parrot_formdesigner.renderers.pdf

View source

PDF AcroForm fillable renderer for FormSchema (FEAT-152 Wave 2b).

Uses reportlab.pdfgen.canvas.Canvas + canvas.acroForm to emit a fillable PDF (AcroForm). Layout: vertical single-column with section headers and label-above-input blocks.

Per Q4 (resolved): fields not natively expressible in AcroForm (FILE, IMAGE, ARRAY, GROUP) become flat textfield placeholders with a form-level meta note listing them.

Output format: RenderedForm(content=<pdf-bytes>, content_type="application/pdf", metadata={"unsupported_fields": [...]}).

Alias AbstractFormRenderer

Re-exported from parrot_formdesigner.renderers.base.AbstractFormRenderer.

Alias FallbackRenderer

Re-exported from parrot_formdesigner.renderers.base.FallbackRenderer.

Alias FieldRenderer

Re-exported from parrot_formdesigner.renderers.base.FieldRenderer.

Alias FieldType

Re-exported from parrot_formdesigner.core.types.FieldType.

Alias FormField

Re-exported from parrot_formdesigner.core.schema.FormField.

Alias FormSchema

Re-exported from parrot_formdesigner.core.schema.FormSchema.

Alias FormSection

Re-exported from parrot_formdesigner.core.schema.FormSection.

Alias FormSubsection

Re-exported from parrot_formdesigner.core.schema.FormSubsection.

Alias LocalizedString

Re-exported from parrot_formdesigner.core.types.LocalizedString.

Class PdfRenderer

Render a FormSchema as a fillable PDF (AcroForm).

Layout: single-column vertical, A4 portrait. Section headers in bold, label above each input. style / prefilled / errors are accepted (per the base contract) but only prefilled is used to seed default values on textfields where supported.

The renderer logs warnings for unsupported field types (FILE/IMAGE/ARRAY/GROUP) and includes them in RenderedForm.metadata["unsupported_fields"].

Method PdfRenderer.render

Render form as a fillable PDF.

render(form: FormSchema, style: StyleSchema | None = None, *, locale: str = 'en', prefilled: dict[str, Any] | None = None, errors: dict[str, str] | None = None) -> RenderedForm

Parameter Type Default Description
form FormSchema The form schema.
style StyleSchema | None None Ignored.
locale str 'en' BCP 47 locale tag for label resolution.
prefilled dict[str, Any] | None None Optional initial values keyed by field_id.
errors dict[str, str] | None None Ignored.

Returns: RenderedForm — RenderedForm carrying the PDF bytes, content_type="application/pdf", and a metadata["unsupported_fields"] list.

Alias RenderWarning

Re-exported from parrot_formdesigner.core.schema.RenderWarning.

Alias RenderedForm

Re-exported from parrot_formdesigner.core.schema.RenderedForm.

Alias StyleSchema

Re-exported from parrot_formdesigner.core.style.StyleSchema.

Alias UPLOAD_FIELD_TYPES

Re-exported from parrot_formdesigner.core.file_envelope.UPLOAD_FIELD_TYPES.

Attribute logger

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