0.2.4 • Published 8 years ago
prince-promise v0.2.4
prince-promise
Convert HTML to PDF using a promise based api for PrinceXML.
Installation
npm install prince-promiseUsage
var prince = require('prince-promise');
var html = 'Hello';
var options = {
licenseFile: 'path',
encrypt: true
};
prince(html)
.then(function (pdf) {
// ...
});API
prince ( html , options )
Converts an HTML string to a PDF. Returns a Promise that is fulfilled with the pdf buffer.
Arguments
html- A string of HTML content to render.options- An object of options to runprincewith. All PrinceXml options are supported and should be set as camelCased properties of this object.For instance:
prince --license-file=path --encryptBecomes:
var options = { licenseFile: 'path', encrypt: true };