How to use the pdfcrowd.saveToFile function in pdfcrowd

To help you get started, we’ve selected a few pdfcrowd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IonicaBizau / learning-nodejs / html-to-pdf / index.js View on Github external
// Dependencies
var pdf = require('pdfcrowd');

// Configs
var config = require("./config")
  , client = new pdf.Pdfcrowd(config.username, config.apiKey)
  ;

// Save to file
var callback = pdf.saveToFile("1123.pdf");
callback.end = function () {
    console.log("File saved successfully.");
}

callback.error = function (error, status) {
    console.log(">? ERROR::", error, status);
}

client.convertURI('google.com', callback);

pdfcrowd

A client library for the Pdfcrowd API. It lets you convert between HTML, PDF and various image formats.

MIT
Latest version published 2 days ago

Package Health Score

65 / 100
Full package analysis