0.1.6 • Published 8 years ago
wkhtmltopdf-promise v0.1.6
wkhtmltopdf-promise
Convert HTML to PDF using Webkit (QtWebKit), wrapped in a Promise
Example
const wkhtmltopdfPromise = require('wkhtmltopdf-promise');
wkhtmltopdfPromise(`
<body>
<div>Content</div>
</body>
`).then(function (pdf_base64) {
// Handle base64 output
}).catch(function (err) {
console.error(err);
});
Options
There are many options available to wkhtmltopdf. All of the command line options are supported as documented on the page linked to above. The options are camelCased instead-of-dashed as in the command line tool. Note that options that do not have values, must be specified as a boolean, e.g. debugJavascript: true
{
"options":
{
"pageSize": "letter"
}
}