Introduction
Doquill turns HTML/CSS templates into PDFs. You write a template once, then your backend sends JSON to the API and gets a document back.
Concepts
Section titled “Concepts”Workspace. Everything belongs to a workspace: templates, assets, API keys, rendered files and webhooks. An API key belongs to exactly one workspace, and every request made with it is scoped to that workspace. You never send a workspace ID.
Template. A set of files: an HTML entry file, optional CSS, an optional running header and footer, and partials. A template can also carry a JSON Schema for its input, sample data for previews, and page settings (size, margins, orientation). See Template structure.
Draft, publish and versions. You edit a template’s draft in the app. Publishing freezes the draft into a numbered, immutable version. Renders use the latest published version unless you ask for a specific one, so editing a draft never changes what your production documents look like until you publish.
Render. A call that combines a template version with your JSON data and returns a document: PDF by default, or PNG, JPEG, HTML or DOCX. Renders are either synchronous (the document comes back in the response) or asynchronous (a job that stores the result as a file and can notify a webhook). See Sync vs async rendering.
Asset. An image or stylesheet uploaded to the workspace under an alias, which
templates reference with the asset function.
File. A stored render result. Async render jobs create files, which you can download, filter by tag and delete through the API.
How a render works
Section titled “How a render works”- Doquill loads the template version and validates your data against its JSON Schema.
- It runs the Go template engine over the HTML and CSS files with your data.
- A headless Chrome prints the result with the template’s page settings.
Templates can’t load anything from the network and run no JavaScript. Everything a document needs comes from the template, its assets and your data.