CraftMyPDF icon

CraftMyPDF

Create beautiful PDF documents with ease using our drag-and-drop template editor. Start from ready-made templates for invoices, certificates, receipts, contracts, and more.

Actions7

PDF → Create

AI-generated

Overview

This node operation creates a PDF document using a specified template and data. It supports generating the PDF either as a JSON object with a CDN-hosted PDF link or as a binary file output for secure and private use. Users can specify various options such as template version, expiration time, password protection, image resizing, and image resampling resolution. This operation is useful for automating the generation of invoices, certificates, receipts, contracts, and other PDF documents based on dynamic data and predefined templates.

Use Case Examples

  1. Generating an invoice PDF from a template with customer data and sending it via email.
  2. Creating a password-protected contract PDF for secure sharing.
  3. Producing a PDF report with resized images to optimize file size.

Properties

Name Meaning
Region Region of the API endpoint to use for the request, affecting the server location handling the PDF creation.
Template ID Identifier of the PDF template to use for generating the document.
Data JSON data to populate the template; supports either a JSON object or a stringified JSON string.
Version Specific version of the template to use; defaults to the latest version if not specified.
Export Type Format of the PDF output, either as a JSON object with a CDN link or as a binary file for secure download.
Expiration Expiration time in minutes for the generated PDF's availability.
Output File Filename to assign to the generated PDF file.
Password Protected Flag to enable password protection on the PDF (requires professional subscription).
Password Password to protect the PDF file if password protection is enabled.
Image Resample Resolution Resolution in DPI to downsample images in the PDF to reduce file size; 0 disables this feature.
Resize Images Flag to resize all images in the PDF to reduce file size, useful for templates with many or large images.
Resize Max Width Maximum width in pixels for resized images.
Resize Max Height Maximum height in pixels for resized images.
Resize Format Format to convert resized images to, either JPEG or PNG.

Output

Binary

Binary data of the generated PDF file when export type is set to 'file'.

JSON

  • template_id - ID of the template used to generate the PDF.
  • data - Input data used to populate the template.
  • version - Template version used for PDF generation.
  • export_type - Format of the PDF output (json or file).
  • expiration - Expiration time in minutes for the generated PDF.
  • output_file - Filename of the generated PDF.
  • password_protected - Indicates if the PDF is password protected.
  • password - Password set for PDF protection, if enabled.
  • image_resample_res - DPI resolution used for image resampling in the PDF.
  • resize_images - Indicates if images in the PDF are resized.
  • resize_max_width - Maximum width for resized images.
  • resize_max_height - Maximum height for resized images.
  • resize_format - Format used for resized images.

Dependencies

  • An API key credential for authentication with the CraftMyPDF API.

Troubleshooting

  • Invalid JSON data input will cause an error; ensure the 'Data' property contains valid JSON.
  • Password protection requires a professional subscription; enabling it without the subscription may cause the request to fail.
  • Choosing 'file' export type returns binary data; ensure downstream nodes can handle binary data properly.
  • Expiration value must be between 1 and 10080 minutes; values outside this range may cause errors.

Links

Discussion