๐Ÿ”ฌ Convert HTML to PDF and compress files with CustomJS API

โšก 2,026 views ยท ๐Ÿ”ฌ Document Extraction & Analysis

Description

workflow.png This n8n template demonstrates how to convert HTML into a PDF, compress the generated PDF, and return it as a binary response using the PDF Toolkit from www.customjs.space.

Notice

Community nodes can only be installed on self-hosted instances of n8n.

@custom-js/n8n-nodes-pdf-toolkit

What this workflow does

Requirements

Workflow Steps:

  1. Manual Trigger:

    • Runs with user interaction.
  2. HTML to PDF:

    • Request HTML Data
    • Convert HTML to PDF
    • Request PDF from URL.
  3. Compress Pages from PDF:

    • Compress PDF as a binary file.

Usage

Get API key from customJS

Set Credentials for CustomJS API on n8n

Copy and paste your API key generated from CustomJS here. 2.png

Design workflow

You can replace logic for triggering and returning results. For example, you can trigger this workflow by calling a webhook and get a result as a response from webhook. Simply replace Manual Trigger and Write to Disk nodes.

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup