Guides
HTML to PDF and HTML email, with working code.
Each guide answers one question, shows the do-it-yourself way properly, and says when an API is the better fit.
How to convert HTML to PDF in Node.jsTwo approaches that work in production, with the code for each: run headless Chrome yourself with Puppeteer, or send the HTML to an API and get the PDF back.6 min readHow to convert HTML to PDF in PythonThree ways that work, with code: WeasyPrint (pure Python, no browser), Playwright (real Chrome), or an API call that returns the PDF.6 min readHow to convert HTML to PDF in PHPDompdf is the common choice in PHP and Laravel. Here is working code for it, where its CSS support stops, and the API alternative.5 min readCSS page breaks for HTML to PDFThe print CSS that makes multi-page invoices and statements look right: page size and margins, table headers on every page, and rows and totals that never split.5 min readHow to generate an invoice PDF from JSONKeep invoice data as JSON, keep the layout in one HTML template, and render the PDF with one call. Worked example for a Nepal VAT invoice; the same pattern covers an Indian GST invoice.6 min readHow to send an email with a PDF attachment in Node.jsThe invoice email and its PDF, sent together. Two ways with working code: Nodemailer plus a PDF you render, or one API call that does both.5 min readHow to build HTML email that works in Gmail and OutlookEmail clients are not browsers. These are the rules that keep a transactional email looking right in Gmail, Outlook and Apple Mail, with a skeleton to start from.6 min read