Skip to content

classcraft/classcraft-meteor-wkhtmltopdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a wrapper around the NPM package wkhtmltopdf, version 0.1.5.

It allows you to create PDFs from HTML, but you need to install external binaries. Docs for wkhtmltopdf are here : https://www.npmjs.com/package/wkhtmltopdf.

Installation

meteor add classcraft:meteor-wkhtmltopdf

Usage

On the server, you have access to a global variable wkhtmltopdf, which you can use like this :

var pdfStream = wkhtmltopdf(html, options);

This allows you to write PDFs doing something like this :

generatePDF = function(html, options) {
    wkhtmltopdf(html, function(code, signal) {
        console.log('worked!', fs.readFileSync('out.pdf').toString());
    }).pipe(fs.createWriteStream('out.pdf'));
}

About

DEPRECATED Use : https://www.npmjs.com/package/wkhtmltopdf instead – Meteor smart package of the meteor-wkhtmltopdf node module.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published