Actions19
- Category Actions
- Document Actions
- Template Actions
Document → Build PDF
AI-generatedSummary
Build a PDF document either from an existing document by its ID or directly from a template optionally using provided settings and data. The generated PDF is downloaded and output as binary data with accompanying metadata.
Inputs
- Build Source (required) — Choose to build the PDF from an existing document ('By Document ID') or create it on-the-fly from a template ('Directly From Template').
- Document ID (required) — (Required if 'Build Source' is 'By Document ID') The ID of the existing document to build the PDF from.
- Template ID (required) — (Required if 'Build Source' is 'Directly From Template') The ID of the template to create the document from.
- Name — (Optional, used only if 'Build Source' is 'Directly From Template') Name for the created document.
- Init (Empty Document) — (Optional, applicable only if building directly from template) Whether to create an empty document without any data.
- Settings (JSON) — (Optional, applicable if building directly from template and not initializing empty) JSON object defining document settings like size, background, color, margin, padding, and font size.
- Data (JSON) — (Optional, applicable if building directly from template and not initializing empty) JSON object representing field data to fill in the document.
- Keep Document — (Optional, applicable if building directly from template) Whether to keep the created document in the user's list after building the PDF. If false, the document is auto-deleted after the file is generated.
Output shape
Each input item produces one output item containing a JSON object with the PDF's download URL and the document ID. It also contains the binary PDF file data attached to the 'data' binary property.
If building from template ('Directly From Template'), a temporary document is created and optionally deleted after PDF generation, based on 'Keep Document'. If building from an existing document, the PDF is built directly from that document ID.
Examples
Example 1: Build PDF from existing document
Set 'Build Source' to 'By Document ID', provide the 'Document ID'. The node outputs the generated PDF file and document metadata.
Example 2: Build PDF directly from template with data
Set 'Build Source' to 'Directly From Template', specify 'Template ID', optionally set 'Name', provide document 'Settings (JSON)' and 'Data (JSON)', and choose whether to keep the document. The node outputs the generated PDF file and document metadata.