prince-promise

Convert HTML to PDF using a promise based api for PrinceXML.

Showing:

Popularity

Downloads/wk

9

GitHub Stars

3

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

6

Size (min+gzip)

31.8KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

prince-promise

Convert HTML to PDF using a promise based api for PrinceXML.

npm version npm license Travis David npm downloads

Installation

npm install prince-promise

Usage

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 run prince with. All PrinceXml options are supported and should be set as camelCased properties of this object.

    For instance:

    prince --license-file=path  --encrypt
    

    Becomes:

    var options = {
      licenseFile: 'path',
      encrypt: true
    };
    

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100