HTML and Remote PDF Document Processing - n8n Workflow

Leverage this powerful n8n workflow to convert HTML content into PDF and accurately extract text from both local and remote PDF documents using specialized n8n nodes and the CustomJS API.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Automation specialists needing to handle document generation and text extraction.
Developers looking for advanced PDF processing n8n templates.
Users of the CustomJS API wanting to see examples of their specific n8n node usage.
Anyone seeking a reliable method to parse static information from PDF documents within an n8n automation.

Overview

Handling PDF documents is a frequent requirement in business automation, yet it often requires specialized tools. This comprehensive n8n workflow solves two common challenges: converting arbitrary HTML content into a portable PDF document, and then extracting valuable text data from both newly generated PDFs and existing files hosted externally (via URL). This particular n8n template utilizes specialized n8n node functionality (CustomJS PDF Toolkit) to achieve seamless document processing. By using this n8n workflow, you gain the capability to streamline processes like documentation archival, web content capturing, and data ingestion from complex PDF formats.

How it Works

This n8n workflow begins with a simple Manual Trigger, allowing the user to initiate the process easily by clicking 'Test workflow'. The core logic immediately branches into two distinct parallel paths to demonstrate different use cases for the specialized PDF n8n node:


  1. Path 1: Dynamic HTML Conversion and Extraction

The flow moves to the 'HTML to PDF' n8n node, which takes a static HTML input (

Hello World

) and converts it into a PDF binary object. This uses the CustomJS API credentials.
The resulting PDF binary is passed to the first 'Convert PDF into Text' n8n node. This node processes the file binary directly and extracts the text, confirming that the HTML was successfully converted and made readable by the n8n workflow.


  1. Path 2: Remote PDF URL Extraction

The parallel path starts with a 'Code' n8n node. This node is used to define a remote PDF URL input, simulating an external source of PDF data required by the n8n workflow.
The data (the URL path) is then sent to the 'Convert PDF into Text1' n8n node. This powerful n8n node is configured to retrieve the PDF from the provided URL, eliminating the need to download the file manually. It then performs the text extraction directly from the remote document.

Installation Guide

To install this n8n workflow template and utilize its full potential, follow these steps:


  1. Install Custom N8N Node: This n8n workflow relies on a third-party package. You must first install the @custom-js/n8n-nodes-pdf-toolkit package in your n8n instance.

  2. Import the n8n Workflow: Copy the provided JSON data. In your n8n interface, navigate to 'Workflows', click 'New', and select 'Import from JSON'.

  3. Set Up Credentials: Both the 'HTML to PDF' and 'Convert PDF into Text' n8n node instances require 'CustomJS API' credentials. Ensure you have set up a connection with the appropriate API key and service details. The n8n workflow will fail without these credentials.

  4. Test the n8n Trigger: Click the 'When clicking ‘Test workflow’' n8n trigger node and run the workflow once to verify that both parallel extraction paths execute successfully and return the extracted text data.

Node Details

When clicking ‘Test workflow’ (Manual Trigger): The initial n8n trigger point for this demonstration n8n workflow. It initiates both document processing paths concurrently.
HTML to PDF: A specialized n8n node that uses the CustomJS API to transform a string of HTML code (

Hello World

) into a PDF file binary, which is then available for downstream n8n nodes.
Convert PDF into Text: This instance of the PdfToText n8n node is configured to take the binary output of the previous 'HTML to PDF' step and extract all plain text content. It processes the internal data generated within this n8n workflow.
Code: This n8n node serves as a dynamic input generator, specifically creating a JSON payload containing the URL path to an external PDF document. This prepares the input required by the subsequent n8n node.

  • Convert PDF into Text1: This second instance of the PdfToText n8n node is configured to use a 'url' resource. It dynamically pulls the PDF file located at the specified path (={{ $json.path }}) and extracts the textual information directly from the remote source. This demonstrates flexibility in your n8n workflow design.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by

Featured*