Convert HTML to professional PDF with Puppeteer and wkhtmltopdf from Cerewro

Convert any HTML document to high-quality PDF with Cerewro: Puppeteer (headless Chrome) for complex documents with CSS and web fonts, wkhtmltopdf for simple documents without Node.js. Margin, header and footer configuration.

Convert HTML to professional PDF with Puppeteer and wkhtmltopdf

There are two main tools for converting HTML to professional-quality PDF on Windows: Puppeteer (uses Chromium headless, ideal for complex CSS and web fonts) and wkhtmltopdf (standalone binary, no Node.js required).

Full Puppeteer conversion script
const puppeteer = require('puppeteer');
async function convertToPdf({ html, output, format = 'A4', margin = {top:'15mm',bottom:'15mm',left:'15mm',right:'15mm'} }) {
  const browser = await puppeteer.launch({ headless: 'new' });
  const page = await browser.newPage();
  await page.setContent(html, { waitUntil: 'networkidle0' });
  await page.pdf({ path: output, format, margin, printBackground: true,
    displayHeaderFooter: true,
    footerTemplate: '<div style="font-size:9px;width:100%;text-align:center;color:#888">Page <span class="pageNumber"></span> of <span class="totalPages"></span></div>' });
  await browser.close();
}
wkhtmltopdf (no Node.js)
choco install wkhtmltopdf -y
wkhtmltopdf --page-size A4 --margin-top 15mm --footer-center "Page [page] of [toPage]" document.html document.pdf
Puppeteerwkhtmltopdf
Modern CSS✅ Perfect⚠️ Limited
Requires Node.jsYesNo
SpeedMediumFast