Auto Convert PDFs to HTML and Publish to Web

3 Minutes Read

What You'll Have When Done A fully automated system that monitors your Google Drive for new PDF documents, instantly converts them into clean HTML files using PDF.co, and publishes the HTML content directly to your web server via FTP for immediate online availability.

Before You Begin

Make sure you have:

  • An n8n Cloud or self-hosted instance
  • A PDF.co account
  • Google Drive connected to n8n
  • FTP or SFTP access to your web server
  • A Google Drive folder for incoming PDFs
  • A destination directory on your web server

Install the PDF.co Node

PDF.co is provided as an n8n community node and may not appear in a new n8n installation automatically.

Before building the workflow:

  1. Open Settings in n8n.
  2. Select Community Nodes.
  3. Install n8n-nodes-pdfco.
  4. Reload the workflow editor if necessary.
  5. Add your PDF.co credentials when configuring the PDF.co node.

Community-node installation must be permitted on your n8n instance. If you do not have permission to install nodes, contact the administrator of your n8n workspace.

Build the Workflow Step by Step

Follow the instructions below to create the workflow manually in n8n.

The finished workflow will:

  1. Monitor a Google Drive folder for new PDF files.
  2. Convert each PDF to HTML using PDF.co.
  3. Upload the resulting HTML file to a web server through FTP or SFTP.

Step 1: Monitor for New PDF Documents

Node: Google Drive Trigger

Settings:

  • Trigger On: Changes Involving a Specific Folder
  • Folder From List: Your source folder
  • Watch For: File Created

What This Does: Automatically detects when a new PDF document is added to your designated Google Drive folder.

Success Looks Like: The trigger outputs file metadata (id, name, webContentLink) as soon as a PDF is uploaded to the folder.

Important: The workflow uses webContentLink to access the PDF file, so ensure your Google Drive folder has appropriate sharing permissions.

Step 2: Convert PDF to HTML

Node: PDF.co API → Convert from PDF

Settings:

  • PDF URL: ={{ $json.webContentLink }}
  • Convert Type: PDF to HTML
  • Advanced Options → Name: ={{ $json.name }}

What This Does: Calls PDF.co to fetch the PDF from Google Drive and convert it into clean, structured HTML code.

Success Looks Like: PDF.co returns HTML content in the response body, ready for web publishing.

You can learn more about PDF to HTML at the API Docs.

Step 3: Publish HTML to Web Server

Node: FTP → Upload

Settings:

  • Path: =htdocs/ {{ $json.name }}
  • Binary Data: False (unchecked)
  • File Content: ={{ $json.body }}

What This Does: Uploads the converted HTML content directly to your web server's public directory via FTP.

Success Looks Like: The HTML file appears in your web directory and is immediately accessible via your website URL.

Congrats! You've created a powerful workflow that transforms static PDF documents into web-accessible HTML content with zero manual effort. Perfect for automatically publishing reports, documentation, brochures, or any PDF content to your website.

Built something cool with this workflow? Share it with us @pdfdotco

Related Tutorials

See Related Tutorials