Skip to content

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

Notifications You must be signed in to change notification settings

panosoft/prince-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
    };

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published