{"repo":"chuongtrh/html_to_pdf","free":true,"listed":false,"github":"https://github.com/chuongtrh/html_to_pdf","clone":"git clone https://github.com/chuongtrh/html_to_pdf.git","description":"Generate a simple invoice PDF from HTML using puppeteer & handlebars","language":"JavaScript","stars":120,"topics":["pdf","puppeteer","handlebars","htmltopdf"],"license":null,"category":"scrapers-browser-automation","readme_excerpt":"html to pdf Generate beautiful PDF invoices from HTML using Puppeteer & Handlebars. Modern, flexible, and easy to use! --- ⭐ Features - Modern rendering: Uses real Chrome engine for pixel-perfect PDFs - Dynamic templates: Handlebars for easy data binding - Watermark/stamp support: Add \"PAID\" or custom stamps with a simple flag - Full CSS/JS support: Works with modern HTML, CSS, and JavaScript - Easy integration: Just a few lines of code to get started --- 🚀 Quick Start 1. Install dependencies 2. Generate your first PDF This will create invoice.pdf in your project folder. --- How It Works 1. Prepare your HTML template ( invoice.html ) 2. Bind your data using Handlebars 3. Generate PDF with Puppeteer --- Example Usage index.js example.js --- 💡 Watermark/Stamp Example Add a \"PAID\" stamp using Handlebars: Set isWatermark: true in your data and run again! --- 🆚 Comparison: Puppeteer vs. wkhtmltopdf vs. dompdf Feature Puppeteer (This Project) wkhtmltopdf dompdf (PHP) ------------------------ ------------------------- ---------------------------- --------------------------- Language Node.js Standalone (CLI, C++) PHP Rendering Engine Headless Chrome WebKit PHP-based HTML parser CSS/JS Support Full (modern browser) Limited (older WebKit) Limited (no JS) JavaScript Execution Yes Partial No Template Engine Handlebars (JS) None (raw HTML) None (raw HTML) Custom Fonts Yes Yes Yes Page Features Headers/Footers, Margins Headers/Footers, Margins Basic Watermark/Stamp Easy (template logic)","default_branch":null,"files":null,"tree":[],"storefront":"/r/chuongtrh","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/chuongtrh/html_to_pdf/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}