Nocturnal Programmer's Machine
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    hypdfpublic

    HyPDF

    Node.js wrapper for the HyPDF Heroku Add-on API

    This is a Node.js version the official Ruby wrapper for working with HyPDF on Heroku

    Installation

    Through NPM

    $ npm install hypdf

    or using Git

    $ git clone git://github.com/treygriffith/hypdf.git node_modules/hypdf/

    How to Use

    var HyPDF = require('hypdf');
     
    var hypdf = new HyPDF(process.env.HYPDF_USER, process.env.HYPDF_PASSWORD, {
      // default options to use - these can be changed for each individual API request 
      bucket: "MY_S3_BUCKET",
      public: true, // all S3 uploads will be public by default 
      test: true // we are in test mode - these requests won't count against our HyPDF quota 
    });
     
    hypdf.htmltopdf("<html><body><h1>Title</h1></body></html>", {
        orientation: 'Landscape',
        copies: 2,
        // ... other options ... 
      },
      function (err, response) {
        if(err) throw err;
     
        console.log(response.pdf);
      }
    );
     

    Documentation

    Full API documentation for HyPDF can be found here.

    Keywords

    none

    install

    npm i hypdf

    Downloadsweekly downloads

    52

    version

    0.1.2

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar