Registry / http-networking / html2pdf

html2pdf

JSON →
library0.0.11jsnpmunverified

A Node.js wrapper for wkhtmltopdf that converts HTML to PDF. Current version 0.0.11 is unmaintained since 2012 and only works with the legacy wkhtmltopdf binary (0.12.x series). Requires wkhtmltopdf to be installed separately on the system. Compared to modern alternatives like puppeteer or pdfmake, it offers no JS rendering support and is essentially deprecated. No release cadence; last commit was years ago. Not recommended for new projects.

http-networkingcommunication
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM import fails because the package has no default export; only CJS require works.

const html2pdf = require('html2pdf');

No named export; the module exports a function directly.

const html2pdf = require('html2pdf');

No types exist; trying to import types will fail.

not applicable (no TypeScript types)

Shows basic usage: converting an HTML string to PDF and piping to a file. Requires wkhtmltopdf binary installed.

const wkhtmltopdf = require('wkhtmltopdf'); const fs = require('fs'); // OR directly using html2pdf wrapper: const html2pdf = require('html2pdf'); // Convert HTML string to PDF const html = '<html><body><h1>Hello World</h1></body></html>'; html2pdf(html, { options: { pageSize: 'A4' } }).pipe(fs.createWriteStream('output.pdf')); console.log('PDF generated'); // Ensure wkhtmltopdf binary is installed and in PATH.
html2pdf --version
Debug
Known footguns
deprecatedPackage is unmaintained since 2012 and wkhtmltopdf itself is in maintenance mode. Use puppeteer or other modern libraries.
breakingRequires wkhtmltopdf binary to be installed on the system; not a pure Node.js solution.
gotchaNo JavaScript rendering; complex CSS and JS-loaded content may not render correctly.
gotchawkhtmltopdf 0.12.6 deprecated and may be removed from distributions; in some Linux distros the package is being dropped.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
11 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
bingbot
1
bytedance
1
Resources