pdfmiweb-pdf-client

Simplifies communications to the API to api.pdfmiweb.com in Node.js

pdfmiweb-pdf-client

Client for Node.js to use pdfmiweb API service. For more informacion go to http://pdfmiweb.com/api

##Usage:

npm install pdfmiweb-pdf-client

var PDFClient = require('pdfmiweb-pdf-client');
var PDF = new PDFClient("http://api.pdfmiweb.com", "[[YOUR APPID]]", "[[YOUR APIKEY]]")

###Creating PDFs Only creates PDFs in API server. for get it use PDF.get()

PDF.create({webPage: "http://www.google.com"}, function (errCreateresCreate) {
    if (resCreate.body) {
        console.log("API says PDF has been created :)");
    } else {
        console.log("API says PDF has not been created :(");
    }
});

###Getting PDFs

//You can get a PDF as stream and do what you want: 
PDF.get({webPage: "http://www.google.com"}, function (resstream) {
    //Its an stream, do what you want! 
});
 
//Or use in tandem with `PDF.save()` to store locally:  
PDF.get({webPage: "http://www.google.com"}, function (resstream) {
    PDF.save(stream, "path/to/save/a-name-for-this.pdf", function (errSavefilepath) {
        if (errSave) throw errSave;
        console.log("PDF has been written in " + filepath);
    });
});