PDF Generation

Generates a PDF file from text or table data

Overview

This node generates a PDF file from either text or table data provided as input. It is useful for automating the creation of PDF documents from dynamic content within workflows, such as generating reports, invoices, or summaries. For example, users can input plain text or table data to produce a downloadable PDF file with a specified filename.

Use Case Examples

  1. Generating a PDF report from textual data input.
  2. Creating a PDF invoice from table data (requires custom logic for table formatting).

Properties

Name Meaning
Content Type Selects whether the content to include in the PDF is plain text or table data.
Content The actual text or table data to be included in the PDF document.
Filename The name of the generated PDF file.
Auto Download Determines whether the PDF should be automatically downloaded after generation.

Output

Binary

Outputs the generated PDF file as binary data with MIME type 'application/pdf'.

JSON

  • filename - The filename of the generated PDF file.
  • pdf - The base64-encoded content of the generated PDF file.

Dependencies

  • Uses the 'pdfkit' library to generate PDF files.

Troubleshooting

  • If the PDF content is not formatted as expected when using 'table' content type, custom logic for table rendering is required as the current implementation only outputs placeholder text.
  • Ensure the 'content' input is properly formatted text or table data to avoid empty or malformed PDFs.
  • If the PDF does not download automatically despite enabling 'Auto Download', verify the environment supports this feature as the current implementation only logs a message without actual download logic.

Discussion