docyrus-print-pdf-template-design
Docyrus Print / PDF Template Design
Design a printable, data-bound report template with docyrus studio create-html-template, then validate its shape and test that it renders to HTML/PDF for a real record. An export template is a row in tenant_html_template: an HTML body (+ optional header/footer/CSS) with {{field}} Handlebars placeholders, bound to a data source, with page setup. Rendering is done via the app's render endpoints (reachable with docyrus curl).
Workflow
-
Confirm app + auth, and the source record shape. An export template must bind to a data source, and its placeholders must match real fields.
docyrus auth who --json docyrus apps list --json docyrus studio list-data-sources --appSlug crm --json # → the data source to bind (required) docyrus studio list-fields --appSlug crm --dataSourceSlug quotes --json # the field slugs to interpolate -
Design the document. Decide the layout (HTML
body), repeating sections ({{#each}}over an own array field or achild.{from}__{using}child data source collection), header/footer HTML, CSS instyles, the page setup (orientation, format, margins), and the output filename pattern (filename_tmpl). See references/template-fields-and-rendering.md. -
Create the template (
create-html-template).--nameand a data source (--dataSourceSlug/--dataSourceId) are required. Add body/header/footer/styles and page options. See Create. -
Validate — read it back and confirm content, page options, and binding landed. See Validate.