n8n-nodes-docxtemplater-pdf-converter
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

n8n-nodes-docx-to-pdf

This is an n8n community node that provides functionality to convert DOCX templates to populated DOCX and PDF files. It allows users to fill in template variables in DOCX files with real data and then convert the resulting document to PDF format.

Features

  • Load DOCX templates with placeholders/variables
  • Populate templates with JSON data
  • Save the populated DOCX files
  • Convert the populated DOCX files to PDF format
  • Comprehensive error handling for all operations

Installation

Follow these steps to install this custom node:

Local Installation (Development)

  1. Clone this repository:

    git clone https://github.com/yourusername/n8n-nodes-docx-to-pdf.git
    
  2. Navigate to the project directory:

    cd n8n-nodes-docx-to-pdf
    
  3. Install dependencies:

    pnpm install
    
  4. Build the code:

    pnpm build
    
  5. Create a symbolic link in your n8n installation:

    npm link
    
  6. In your n8n installation directory:

    npm link n8n-nodes-docx-to-pdf
    

Global Installation (Production)

Once published, you can install this node globally using npm:

npm install n8n-nodes-docx-to-pdf -g

Or if you use n8n desktop app, install it through the Community Nodes tab.

Usage

  1. Add the DocxToPdf node to your workflow.
  2. Configure the following settings:
    • Template File: Path to your DOCX template file with variables in the format {{ variableName }}
    • Output DOCX File: Path where you want to save the populated DOCX file
    • Output PDF File: Path where you want to save the converted PDF file
    • JSON Data: JSON object with key-value pairs that match the variables in your template

Example Template

Your DOCX template might include variables like:

Dear {{ name }},

Thank you for your {{ product }} order.
Your order number is {{ orderNumber }}.

Best regards,
{{ companyName }}

Example JSON Data

{
  "name": "John Doe",
  "product": "Premium Subscription",
  "orderNumber": "ORD-12345",
  "companyName": "Your Company Name"
}

Publishing to npm

To publish this node to npm, follow these steps:

  1. Update package.json with your information:

    • Update the name, author, repository, and homepage fields
    • Make sure the version is correct
  2. Build the package:

    pnpm build
    
  3. Login to npm:

    npm login
    
  4. Publish the package:

    npm publish
    

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Package Sidebar

Install

npm i n8n-nodes-docxtemplater-pdf-converter

Weekly Downloads

14

Version

0.1.7

License

MIT

Unpacked Size

81.8 kB

Total Files

12

Last publish

Collaborators

  • epaledev