CraftMyPdf icon

CraftMyPdf

Consume the CraftMyPDF API

Actions7

Overview

This node integrates with the CraftMyPDF API to perform various PDF and image processing tasks, as well as account information retrieval and transaction listing. It is useful for automating document generation workflows, such as creating PDFs or images from templates with dynamic data, merging multiple PDFs, adding watermarks, or retrieving account details.

Common scenarios include:

  • Generating customized PDF reports or invoices from JSON data.
  • Creating images based on templates for marketing or documentation.
  • Merging multiple PDF documents into a single file.
  • Adding watermarks to PDFs for branding or copyright protection.
  • Retrieving account information or transaction history from the CraftMyPDF service.

Properties

Name Meaning
Region The endpoint region to use for API requests. Options include: Default Endpoint, Australia, Europe (Frankfurt), US East (N. Virginia), Alternative endpoints for Europe, Singapore, US East, and a Staging endpoint.

Output

The node outputs an array of JSON objects representing the response from the CraftMyPDF API for each input item processed. Depending on the operation:

  • For "create" operations with export_type set to "json", the output contains JSON data describing the generated PDF or image.
  • For "create" operations with export_type set to "file", the node outputs binary file data representing the generated PDF or image file.
  • Other operations like merging PDFs or adding watermarks return JSON responses with relevant metadata or URLs.
  • Account info and transaction list operations return JSON objects with the respective data.

If binary files are returned, they represent the actual PDF or image files created by the API.

Dependencies

  • Requires an API key credential for authenticating with the CraftMyPDF API.
  • Uses the CraftMyPDF API endpoints corresponding to the selected region.
  • No additional external dependencies beyond the API access.

Troubleshooting

  • Invalid JSON Data: If the input JSON data for template rendering is malformed, the node throws an error indicating "Data: Invalid JSON". Ensure that the JSON input is correctly formatted.
  • API Request Failures: Network issues or invalid credentials can cause request failures. Verify API keys and network connectivity.
  • Unsupported Export Types: Using unsupported export types may cause errors. Supported export types are "json" and "file".
  • Missing Required Parameters: Operations require specific parameters (e.g., template ID, URLs). Missing these will result in errors.
  • To continue processing other items despite errors, enable the "Continue On Fail" option in the node settings.

Links and References

Discussion