// n8n integration

Compress PDFs

All nodes are available on both n8n Cloud and self-hosted n8n and require you to install the CustomJS community package. See Installation.

The Compress Pages from PDF node allows you to compress PDF files using n8n. You can further extend this workflow to convert HTML or code into a PDF, compress the generated PDF, and return it as a binary response.
Compress PDFs with n8n
Compress PDFs with n8n

Compress PDFs

  1. Open a new n8n workflow and add a Webhook node (or use Request HTML or Code if you want to fetch stored PDFs).
  2. Add the Compress Pages from PDF (customJS) node from the PDF Toolkit.
  3. Connect the incoming PDF file to this node.
  4. In the node settings, choose which PDF pages to compress.
  5. Configure the output settings:
    • Set the file name for the compressed PDF.
    • Define the storage location (e.g., with Read/Write Files from Disk).
  6. (Optional) Add a Respond to Webhook node to return the compressed PDF directly to the requester.

n8n workflow template: Convert HTML to PDF and compress files

This workflow template:

  1. Converts the requested HTML to PDF.
  2. Compresses the PDF file.
  3. Handles URLs pointing to PDF files if they exceed 6MB.
  4. Compresses the PDF pages.
Use this template

Related Articles

Continue reading on similar topics

Make.com PDF Generation: Complete Guide 2025
·Guide

Make.com PDF Generation: Complete Guide 2025

Learn how to automate PDF generation in Make.com with CustomJS. Step-by-step guide with templates for invoices, HTML to PDF, and page extraction. 600 free PDFs/month.

makepdfautomation
PDF Generation in Power Automate: Complete Guide 2025
·Guide

PDF Generation in Power Automate: Complete Guide 2025

Generate professional PDFs in Power Automate with CustomJS. Create invoices, receipts, reports, and certificates with custom HTML templates, QR codes, and advanced formatting. No Azure Functions required.

power-automatepdfhtml-to-pdf