Overview
This node integrates with the PDFMonkey API to manage PDF documents. It allows users to generate PDFs from templates, retrieve document details, download generated files, and delete documents. This is useful in workflows where automated PDF generation and management are required, such as generating invoices, reports, contracts, or certificates dynamically based on input data.
For example, a user can create a PDF invoice by providing a template ID and payload data, wait for the PDF to be generated, then automatically download the file for further processing or storage.
The Download File operation specifically downloads a generated PDF or image file associated with a given document ID, provided that the document generation has completed successfully.
Properties
| Name | Meaning |
|---|---|
| Document ID | The ID of the generated document to download. |
Output
The output JSON contains information about the downloaded file, including:
message: Confirmation message indicating successful download.documentId: The ID of the document downloaded.status: The status of the document (should be"success"for a downloadable file).filename: The name of the downloaded file.
The output also includes a binary data field named
datacontaining the actual PDF or image file content, prepared with the correct MIME type based on the filename.
If the document is not ready for download (i.e., its status is not "success"), the node outputs a JSON message indicating the document is not ready along with its current status, but no binary data.
Dependencies
- Requires an API key credential for authenticating with the PDFMonkey API.
- Makes HTTP requests to the PDFMonkey API endpoints.
- Uses helper functions to download files and prepare binary data within n8n.
Troubleshooting
- Document Not Ready for Download: If the document status is not
"success", the node will warn and output a message stating the document is not ready. Users should ensure the document generation process has completed before attempting to download. - Invalid Document ID: Providing an incorrect or non-existent document ID will likely cause API errors. Verify the document ID is correct.
- API Authentication Errors: Ensure the API key credential is valid and properly configured.
- Network Issues: Connectivity problems may cause HTTP request failures.
- File Preparation Errors: Rarely, issues preparing binary data might occur if the file is corrupted or the filename is missing.