{"_id":"@amirmky912/n8n-nodes-html-to-pdf","_rev":"5-4e87e46944d753931a2b0ea8ca536a7b","name":"@amirmky912/n8n-nodes-html-to-pdf","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.0":{"name":"@amirmky912/n8n-nodes-html-to-pdf","version":"0.1.0","keywords":["n8n","n8n-community-node","html-to-pdf","pdf","cloudflare","browser-run","rtl","farsi","vazirmatn"],"license":"MIT","_id":"@amirmky912/n8n-nodes-html-to-pdf@0.1.0","maintainers":[{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"}],"homepage":"https://github.com/Amirezamky9/n8n-html-to-pdf#readme","bugs":{"url":"https://github.com/Amirezamky9/n8n-html-to-pdf/issues"},"n8n":{"nodes":["dist/nodes/HtmlToPdf/HtmlToPdf.node.js"],"credentials":[]},"dist":{"shasum":"3af0b650ba6ceef6a7e9f721c65c8c09a5ca6ecc","tarball":"https://registry.npmjs.org/@amirmky912/n8n-nodes-html-to-pdf/-/n8n-nodes-html-to-pdf-0.1.0.tgz","fileCount":9,"integrity":"sha512-B+k4oq/6DFxZaKX6t7ilifPhN3YaKUm/trfxUbO9yXyiKj/2CAYY6gwEgF00++9no7Ac7QSmiqQpnFQuoM/2mg==","signatures":[{"sig":"MEUCIQDbPkYcidQQtdaNWX75bkrj1CVw5S8WbC9prhuM5xCXiAIgVqP2uf5BFcM4gFv4TSiMZdR+TO8iENOKz/LDeDJHicQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32164},"main":"dist/nodes/HtmlToPdf/HtmlToPdf.node.js","types":"dist/nodes/HtmlToPdf/HtmlToPdf.node.d.ts","gitHead":"3f39ce0b013bda2f38b57a003b382a657b88dad8","scripts":{"dev":"tsc --watch","build":"tsc && cp nodes/HtmlToPdf/htmltopdf.svg dist/nodes/HtmlToPdf/","prepublishOnly":"npm run build"},"_npmUser":{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"},"repository":{"url":"git+https://github.com/Amirezamky9/n8n-html-to-pdf.git","type":"git"},"_npmVersion":"10.9.2","description":"n8n community node for HTML-to-PDF conversion via Cloudflare Browser Run","directories":{},"_nodeVersion":"22.15.0","dependencies":{"n8n-workflow":"^1.74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^26.1.2"},"_npmOperationalInternal":{"tmp":"tmp/n8n-nodes-html-to-pdf_0.1.0_1785264572043_0.561694561217664","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@amirmky912/n8n-nodes-html-to-pdf","version":"0.2.0","keywords":["n8n","n8n-community-node","html-to-pdf","pdf","cloudflare","browser-run","rtl","farsi","vazirmatn"],"license":"MIT","_id":"@amirmky912/n8n-nodes-html-to-pdf@0.2.0","maintainers":[{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"}],"homepage":"https://github.com/Amirezamky9/n8n-html-to-pdf#readme","bugs":{"url":"https://github.com/Amirezamky9/n8n-html-to-pdf/issues"},"n8n":{"nodes":["dist/nodes/HtmlToPdf/HtmlToPdf.node.js"],"credentials":[]},"dist":{"shasum":"feac285d7b35e7b10ffcecf2146ca91efd45fbec","tarball":"https://registry.npmjs.org/@amirmky912/n8n-nodes-html-to-pdf/-/n8n-nodes-html-to-pdf-0.2.0.tgz","fileCount":9,"integrity":"sha512-UyM0HkRgdcGdBLixkEEXwZ6Ew/3ICLLOHGkaBxC3OngbxfHpvREv9DU5o8Cs2PKqZZa1m64j8MjhkmwUrQ0yEg==","signatures":[{"sig":"MEUCIAviaV8CuR9aYYtIJ0UsSmYVuJZONy8AXK4qwOQepRVCAiEAxsi0oJZ+xkQ9OUvCznQM/1+GBB2pv3E7HNGrnHWGh2E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45949},"main":"dist/nodes/HtmlToPdf/HtmlToPdf.node.js","types":"dist/nodes/HtmlToPdf/HtmlToPdf.node.d.ts","gitHead":"3f39ce0b013bda2f38b57a003b382a657b88dad8","scripts":{"dev":"tsc --watch","build":"tsc && cp nodes/HtmlToPdf/htmltopdf.svg dist/nodes/HtmlToPdf/","prepublishOnly":"npm run build"},"_npmUser":{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"},"repository":{"url":"git+https://github.com/Amirezamky9/n8n-html-to-pdf.git","type":"git"},"_npmVersion":"10.9.2","description":"n8n community node for HTML-to-PDF conversion via Cloudflare Browser Run","directories":{},"_nodeVersion":"22.15.0","dependencies":{"n8n-workflow":"^1.74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^26.1.2"},"_npmOperationalInternal":{"tmp":"tmp/n8n-nodes-html-to-pdf_0.2.0_1785268901561_0.579075892535208","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@amirmky912/n8n-nodes-html-to-pdf","version":"0.3.0","keywords":["n8n","n8n-community-node","html-to-pdf","pdf","cloudflare","browser-run","rtl","farsi","vazirmatn"],"license":"MIT","_id":"@amirmky912/n8n-nodes-html-to-pdf@0.3.0","maintainers":[{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"}],"homepage":"https://github.com/Amirezamky9/n8n-html-to-pdf#readme","bugs":{"url":"https://github.com/Amirezamky9/n8n-html-to-pdf/issues"},"n8n":{"nodes":["dist/nodes/HtmlToPdf/HtmlToPdf.node.js"],"credentials":[]},"dist":{"shasum":"3052ae9e5b826717746827df5472e9b40b32b936","tarball":"https://registry.npmjs.org/@amirmky912/n8n-nodes-html-to-pdf/-/n8n-nodes-html-to-pdf-0.3.0.tgz","fileCount":9,"integrity":"sha512-9S9qXEaYkeCT3GPS+4KZ3xVYRlgQe611aCKar0YJGHufAfwYFuSUuBqYjDZil73CBrS2wAMoMHh0bKTloSvvfA==","signatures":[{"sig":"MEYCIQDf72CehlbRRyaAeyPdRBct8bUnjI9im3bLcX1YSPi52AIhAJA/z/8nXXVRlH/H7E7jQ7cwUkTTix7b48+VMzJ65uI2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46538},"main":"dist/nodes/HtmlToPdf/HtmlToPdf.node.js","types":"dist/nodes/HtmlToPdf/HtmlToPdf.node.d.ts","gitHead":"8c51e64701e8d4bf62ae9f94e3bdef4eda307947","scripts":{"dev":"tsc --watch","build":"tsc && cp nodes/HtmlToPdf/htmltopdf.svg dist/nodes/HtmlToPdf/","prepublishOnly":"npm run build"},"_npmUser":{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"},"repository":{"url":"git+https://github.com/Amirezamky9/n8n-html-to-pdf.git","type":"git"},"_npmVersion":"10.9.2","description":"n8n community node for HTML-to-PDF conversion via Cloudflare Browser Run","directories":{},"_nodeVersion":"22.15.0","dependencies":{"n8n-workflow":"^1.74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^26.1.2"},"_npmOperationalInternal":{"tmp":"tmp/n8n-nodes-html-to-pdf_0.3.0_1785272782993_0.8473684102248533","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@amirmky912/n8n-nodes-html-to-pdf","version":"0.3.1","keywords":["n8n","n8n-community-node","html-to-pdf","pdf","screenshot","cloudflare-worker","browser-rendering","puppeteer","rtl","farsi","vazirmatn","echarts"],"author":{"name":"Amirreza Mokhtari","email":"amirrezamokhtari2000@gmail.com"},"license":"MIT","_id":"@amirmky912/n8n-nodes-html-to-pdf@0.3.1","maintainers":[{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"}],"homepage":"https://github.com/Amirezamky9/n8n-html-to-pdf","bugs":{"url":"https://github.com/Amirezamky9/n8n-html-to-pdf/issues"},"n8n":{"nodes":["dist/nodes/HtmlToPdf/HtmlToPdf.node.js"],"credentials":[]},"dist":{"shasum":"67251467d328e675efbda6278d18dd281ce791dd","tarball":"https://registry.npmjs.org/@amirmky912/n8n-nodes-html-to-pdf/-/n8n-nodes-html-to-pdf-0.3.1.tgz","fileCount":6,"integrity":"sha512-sbeS8+Uq3zGRcqtcBVniXFmP1u9dz8fUH7PSR5uBVPKZMJQIFzvU7wk0WX5VQCBPl1yE4S9MQFBrEnaKWXky5g==","signatures":[{"sig":"MEYCIQD88v0PLdhRHmki1/8hzRUFdbcTN6qXJD1aLXYzSEtFrgIhAMWajxcUHsEenPOHb8xfYkck5E2OgnwPYDEBUuDLGcp8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":42431},"main":"dist/index.js","gitHead":"941493b9efa75effe115bf4f10bf2c34a480b83d","scripts":{"dev":"tsc --skipLibCheck --watch","build":"tsc --skipLibCheck"},"_npmUser":{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"},"repository":{"url":"git+https://github.com/Amirezamky9/n8n-html-to-pdf.git","type":"git"},"_npmVersion":"10.9.2","description":"n8n community node for HTML → PDF / PNG / JPEG conversion via Cloudflare Browser Rendering. Supports RTL/Farsi, ECharts charts, batch processing, and custom fonts.","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.0"},"peerDependencies":{"n8n-workflow":"*"},"_npmOperationalInternal":{"tmp":"tmp/n8n-nodes-html-to-pdf_0.3.1_1785275266757_0.4209656164551121","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@amirmky912/n8n-nodes-html-to-pdf","version":"0.3.2","description":"n8n community node for HTML → PDF / PNG / JPEG conversion via Cloudflare Browser Rendering. Supports RTL/Farsi, ECharts charts, batch processing, and custom fonts.","keywords":["n8n","n8n-community-node","html-to-pdf","pdf","screenshot","cloudflare-worker","browser-rendering","puppeteer","rtl","farsi","vazirmatn","echarts"],"license":"MIT","author":{"name":"Amirreza Mokhtari","email":"amirrezamokhtari2000@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/Amirezamky9/n8n-html-to-pdf.git"},"homepage":"https://github.com/Amirezamky9/n8n-html-to-pdf","bugs":{"url":"https://github.com/Amirezamky9/n8n-html-to-pdf/issues"},"main":"dist/index.js","scripts":{"build":"tsc --skipLibCheck","dev":"tsc --skipLibCheck --watch"},"n8n":{"nodes":["dist/nodes/HtmlToPdf/HtmlToPdf.node.js"],"credentials":[]},"peerDependencies":{"n8n-workflow":"*"},"devDependencies":{"typescript":"^5.3.0"},"_id":"@amirmky912/n8n-nodes-html-to-pdf@0.3.2","gitHead":"941493b9efa75effe115bf4f10bf2c34a480b83d","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-5Rz0gnXajdh+2D4eBMJ+MOvCgPHcXfcOzkthm1XbprM8V2cx8IIBUYJyzyi7txy6fFBLaqi+sD1vLuNap35LOA==","shasum":"9caf1d776bb818641c1bbcb7df2bb9c5ff675a28","tarball":"https://registry.npmjs.org/@amirmky912/n8n-nodes-html-to-pdf/-/n8n-nodes-html-to-pdf-0.3.2.tgz","fileCount":7,"unpackedSize":48353,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDdmmU+lKFJgrJL2xnl1Wavtro8lW8p/kD+woqzjl/6uAIgLqXpXeS4IpdNqn+WvWAI9TxirZNLNhicnA+PQR7HW70="}]},"_npmUser":{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"},"directories":{},"maintainers":[{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/n8n-nodes-html-to-pdf_0.3.2_1785275316558_0.21913597006237073"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-28T18:49:31.885Z","modified":"2026-07-28T21:48:36.860Z","0.1.0":"2026-07-28T18:49:32.174Z","0.2.0":"2026-07-28T20:01:41.747Z","0.3.0":"2026-07-28T21:06:23.143Z","0.3.1":"2026-07-28T21:47:46.891Z","0.3.2":"2026-07-28T21:48:36.699Z"},"bugs":{"url":"https://github.com/Amirezamky9/n8n-html-to-pdf/issues"},"author":{"name":"Amirreza Mokhtari","email":"amirrezamokhtari2000@gmail.com"},"license":"MIT","homepage":"https://github.com/Amirezamky9/n8n-html-to-pdf","keywords":["n8n","n8n-community-node","html-to-pdf","pdf","screenshot","cloudflare-worker","browser-rendering","puppeteer","rtl","farsi","vazirmatn","echarts"],"repository":{"type":"git","url":"git+https://github.com/Amirezamky9/n8n-html-to-pdf.git"},"description":"n8n community node for HTML → PDF / PNG / JPEG conversion via Cloudflare Browser Rendering. Supports RTL/Farsi, ECharts charts, batch processing, and custom fonts.","maintainers":[{"name":"amirmky912","email":"amirrezamokhtari2000@gmail.com"}],"readme":"# n8n-nodes-html-to-pdf\n\n> 📄 **HTML → PDF / PNG / JPEG** for n8n — powered by Cloudflare Browser Rendering\n\n[![npm version](https://img.shields.io/npm/v/@amirmky912/n8n-nodes-html-to-pdf)](https://www.npmjs.com/package/@amirmky912/n8n-nodes-html-to-pdf)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![n8n](https://img.shields.io/badge/n8n-community-node-green)](https://n8n.io)\n\n---\n\n## ✨ Features\n\n| Feature | Description |\n|---------|-------------|\n| 📄 **PDF Generation** | Convert HTML to high-quality PDF with custom page sizes, margins, and orientation |\n| 🖼️ **Screenshot** | Capture web pages as PNG or JPEG images |\n| 🌐 **URL Mode** | Render any live URL to PDF/image |\n| 🇮🇷 **RTL/Farsi** | Auto-injects Vazirmatn font for perfect Persian/Arabic text |\n| 📊 **ECharts** | Bar, line, pie, and donut charts render natively in PDFs |\n| ⚡ **Fast** | Cloudflare edge network — typically < 5 seconds |\n| 🔄 **Auto-retry** | Handles transient Worker errors automatically |\n| 📦 **Batch** | Process multiple items in one workflow execution |\n| 🎨 **Print-ready** | Background colors, gradients, and images render correctly |\n\n---\n\n## 🚀 Quick Start\n\n### 1. Install in n8n\n\n```bash\n# In your n8n instance directory:\nnpm install @amirmky912/n8n-nodes-html-to-pdf\n# Restart n8n\n```\n\n### 2. Deploy the Worker\n\n```bash\ngit clone https://github.com/Amirezamky9/n8n-html-to-pdf.git\ncd n8n-html-to-pdf/cloudflare-worker\nnpm install\nnpx wrangler deploy\n```\n\n### 3. Use in n8n\n\n1. Add an **HTML to PDF** node to your workflow\n2. Set the **Worker URL** to your deployed Worker\n3. Connect an HTML Template node or provide HTML directly\n4. Run — PDF is output as binary data\n\n---\n\n## 📋 Node Parameters\n\n| Parameter | Type | Default | Description |\n|-----------|------|---------|-------------|\n| **Source** | options | `html` | `HTML Content` or `URL` |\n| **HTML Source** | options | `field` | `Field (from previous node)` or `Direct HTML` |\n| **HTML Field** | string | `html` | Name of the input field containing HTML |\n| **URL** | string | — | Webpage URL to capture |\n| **Worker URL** | string | — | Your Cloudflare Worker endpoint |\n| **Output Format** | options | `pdf` | `PDF`, `PNG`, or `JPEG` |\n| **Page Format** | options | `A4` | `A4`, `Letter`, or `Legal` (PDF only) |\n| **Orientation** | options | `Portrait` | `Portrait` or `Landscape` |\n| **Print Backgrounds** | boolean | `true` | Render backgrounds, gradients, images |\n| **Wait for JavaScript** | number | `2000` | ms to wait for JS rendering (increase for charts) |\n| **Full Page** | boolean | `false` | Capture entire scrollable page |\n| **Quality** | number | `80` | JPEG quality (1-100) |\n| **Margins** | collection | `10mm` | Top, bottom, left, right margins |\n| **Custom Scripts** | string[] | `[]` | CDN URLs to inject (e.g., Chart.js) |\n| **Custom Fonts** | collection | Vazirmatn | Override default font |\n| **Output Field** | string | `pdf` | Binary output field name |\n| **Filename** | string | `report.pdf` | Output filename |\n\n---\n\n## 📊 ECharts Support\n\nAdd ECharts to your HTML and the Worker auto-injects the library:\n\n```html\n<div class=\"chart-box\"\n  data-chart\n  data-chart-config='{\n    \"xAxis\": { \"type\": \"category\", \"data\": [\"Jan\", \"Feb\", \"Mar\"] },\n    \"yAxis\": { \"type\": \"value\" },\n    \"series\": [{ \"type\": \"bar\", \"data\": [120, 200, 150] }]\n  }'>\n</div>\n```\n\nSupported chart types: `bar`, `line`, `pie`, `donut`, `scatter`, `radar`\n\n---\n\n## 🌐 URL Mode\n\nCapture any live webpage:\n\n```json\n{\n  \"source\": \"url\",\n  \"urlContent\": \"https://example.com\",\n  \"outputFormat\": \"pdf\"\n}\n```\n\n---\n\n## 🇮🇷 RTL & Farsi Support\n\nVazirmatn font is **auto-injected** by the Worker. Just set `dir=\"rtl\"` on your HTML:\n\n```html\n<html dir=\"rtl\" lang=\"fa\">\n<body>\n  <h1>گزارش مالی شرکت</h1>\n  <p>متن فارسی با فونت وزیرمتن</p>\n</body>\n</html>\n```\n\n---\n\n## ⚙️ Worker API\n\n### Endpoints\n\n| Method | Path | Description |\n|--------|------|-------------|\n| `POST` | `/api/convert` | Convert HTML/URL to PDF/PNG/JPEG |\n| `POST` | `/api/pdf` | Legacy alias for `/api/convert` |\n| `GET` | `/api/health` | Health check |\n\n### Request Body\n\n```json\n{\n  \"htmlBase64Gzip\": \"<gzip+base64 encoded HTML>\",\n  \"url\": \"https://example.com\",\n  \"outputFormat\": \"pdf\",\n  \"options\": {\n    \"format\": \"A4\",\n    \"landscape\": false,\n    \"printBackground\": true,\n    \"waitTimeout\": 2000,\n    \"fullPage\": false,\n    \"margin\": { \"top\": \"10mm\", \"bottom\": \"10mm\", \"left\": \"10mm\", \"right\": \"10mm\" }\n  }\n}\n```\n\n### Response\n\nBinary file (PDF/PNG/JPEG) with appropriate Content-Type.\n\n---\n\n## 🔧 Troubleshooting\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| Worker crash (1101) | Browser concurrency limit | Retry automatically; wait 3s between requests |\n| \"Field is empty\" | Input field name mismatch | Check the HTML field name matches your previous node's output |\n| Charts not rendering | JS not finished | Increase `Wait for JavaScript` to 5000-10000ms |\n| Empty PDF | HTML not loaded | Ensure HTML is valid and contains visible content |\n| 502/503 error | Worker cold start | Wait 5-10 seconds and retry |\n\n---\n\n## 📦 Changelog\n\n### v0.3.1\n- Friendly error messages with actionable hints\n- Auto-retry on transient Worker errors (2 retries with backoff)\n- Input validation before Worker call\n- Better MIME type handling\n- Improved npm package metadata and keywords\n\n### v0.3.0\n- Auto-gzip HTML before sending to Worker (bypasses 100KB limit)\n- Handlebars template renderer support\n\n### v0.2.1\n- htmlBase64Gzip support (gzip + base64 encoding)\n- Browser concurrency retry logic (3 attempts)\n- node:zlib decompression\n\n### v0.2.0\n- PNG and JPEG output formats\n- URL mode (render live webpages)\n- Full page capture\n- Custom margins, scripts, and fonts\n\n---\n\n## 📄 License\n\nMIT © [Amirreza Mokhtari](https://github.com/Amirezamky9)\n","readmeFilename":"README.md"}