n8n-nodes-pdf-generation

0.1.0 • Public • Published

PDF Generation Node

The PDF Generation Node in n8n allows you to generate PDF files from text or table data. This node supports flexible content types, including plain text and tables, and can generate a downloadable PDF document. You can easily integrate this node into your workflow to automate document creation tasks.

Features:

  • Content Type Options: Choose between text or table data for your PDF content.
  • Customizable Filename: Define a custom filename for the generated PDF.
  • Auto Download Option: Enable automatic download of the generated PDF once it's created.

Installation

To use the PDF Generation Node, you first need to have n8n installed. If you don't have it yet, please refer to the n8n installation guide.

Node Settings

1. Content Type (options)

  • Description: Select the type of content to include in the generated PDF.
  • Options:
    • Text: Plain text content.
    • Table: Table data (custom logic required for handling table data).
  • Default: Text

2. Content (string)

  • Description: Provide the text or table data to be included in the PDF. The content will be inserted into the generated PDF.
  • Default: Empty
  • Placeholder: Enter the content to include in the PDF...

3. Filename (string)

  • Description: Specify the name of the PDF file generated.
  • Default: output.pdf

4. Auto Download (boolean)

  • Description: Choose whether to automatically download the PDF once it's generated.
  • Default: false

Example Workflow

Here’s an example of how to use the PDF Generation node:

Input Data:

{
  "contentType": "text",
  "content": "This is a sample PDF document generated by n8n.",
  "filename": "sample-output.pdf",
  "autoDownload": true
}

Output:

The output will be a base64 encoded PDF file and the filename specified:

{
  "json": {
    "filename": "sample-output.pdf",
    "pdf": "base64-encoded-pdf-content"
  },
  "binary": {
    "data": {
      "mimeType": "application/pdf",
      "data": "base64-encoded-pdf-content",
      "fileName": "sample-output.pdf"
    }
  }
}

Example Usage

  1. Text PDF: If the content type is set to "text," the provided content is inserted into the PDF as plain text.
  2. Table PDF: If the content type is set to "table," you would need to customize the logic to insert table data into the PDF. (You can use libraries or custom formatting to handle tables.)

Package Sidebar

Install

npm i n8n-nodes-pdf-generation

Homepage

n8n.io

Weekly Downloads

159

Version

0.1.0

License

MIT

Unpacked Size

735 kB

Total Files

30

Last publish

Collaborators

  • tuananhit1612