Automate HTML to PDF Conversion with Gotenberg
detail.loadingPreview
Effortlessly transform your HTML content into professional PDF documents. This n8n workflow leverages the powerful Gotenberg service to automate the creation of high-quality PDFs from any HTML input, perfect for reports, invoices, or dynamic content.
About This Workflow
This robust n8n workflow provides a streamlined solution for converting dynamic HTML content into polished PDF files. It begins by accepting your HTML string and a desired filename as input. The HTML is then prepared and securely sent to a self-hosted Gotenberg service, a powerful document conversion microservice. The workflow dynamically applies customizable metadata to your PDFs, such as author, title, and creation date, ensuring professional output. Ideal for automating document generation, this workflow empowers users to create branded, shareable PDFs with ease, fully integrated into their n8n automation ecosystem. The Gotenberg service acts as the backend, ensuring high-fidelity conversions.
Key Features
- Automated HTML to PDF Conversion: Instantly transform any HTML content into a PDF document.
- Customizable PDF Metadata: Easily define attributes like Author, Title, Subject, and Keywords directly within the workflow.
- Dynamic File Naming: Automatically generate output PDF filenames based on your input.
- Leverages Gotenberg Power: Utilizes the high-performance Gotenberg service for reliable and scalable document rendering.
- Simple Integration: Seamlessly connect into existing n8n workflows for automated document generation.
How To Use
-
Prerequisite: Set up Gotenberg: Ensure you have a running Gotenberg service. The easiest way is to add it to your
docker-compose.yml(if using Docker) and restart your stack: yaml gotenberg: image: gotenberg/gotenberg:8 restart: always -
Workflow Trigger (Create PDF from HTML): This node expects a JSON input with two fields:
html: Your full HTML content as a string.file_name: The desired name for your output PDF (e.g.,my-report-2024).
-
Convert to PDF with Gotenberg (HTTP Request node):
- Update URL: If your Gotenberg service is not running on the same Docker network as n8n, you must update the
URLparameter fromhttp://gotenberg:3000/forms/chromium/convert/htmlto your Gotenberg instance's accessible URL. - Customize Metadata: Under
Body Parameters, locate themetadatafield. You can edit the JSON object to customize PDF properties likeAuthor,Title,Subject,Keywords, andCreator. Dates are automatically generated using n8n expressions.
- Update URL: If your Gotenberg service is not running on the same Docker network as n8n, you must update the
Apps Used
Workflow JSON
{
"id": "9be18fdb-89cb-4f6d-9573-184191ce94e8",
"name": "Automate HTML to PDF Conversion with Gotenberg",
"nodes": 8,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 9be18fdb-89cb...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Google Sheets to Icypeas: Automated Bulk Domain Scanning
This workflow streamlines the process of performing bulk domain scans by integrating your Google Sheets data directly with the Icypeas platform. Automate the submission of company names from your spreadsheet to Icypeas for comprehensive domain information, saving valuable time and effort.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.