0.1.5 • Published 11 years ago

pdfmiweb-pdf-client v0.1.5

Weekly downloads
7
License
-
Repository
github
Last release
11 years ago

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 (errCreate, resCreate) {
    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 (res, stream) {
    //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 (res, stream) {
    PDF.save(stream, "path/to/save/a-name-for-this.pdf", function (errSave, filepath) {
        if (errSave) throw errSave;
        console.log("PDF has been written in " + filepath);
    });
});
0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago