How to use pdfcrowd - 6 common examples

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);
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);
github jsonresume / registry-server / server.js View on Github external
// require('dotenv').load();
require('./lib/mongoose-connection');
var redis = require('./lib/redis-connection');
var express = require("express");
var path = require('path');
var bodyParser = require('body-parser');
var pdf = require('pdfcrowd');
var client = new pdf.Pdfcrowd('thomasdavis', '7d2352eade77858f102032829a2ac64e');
var app = express();
var request = require('superagent');
var expressSession = require('express-session');
var cookieParser = require('cookie-parser');
var compress = require('compression');
var minify = require('express-minify');
var controller = require('./controller');

var points = [];
var DEFAULT_THEME = 'modern';

var RedisStore = require('connect-redis')(expressSession);

app.use(compress());
app.use(minify({
    cache: __dirname + '/cache'
github jsonresume / registry-server / controller / renderResume.js View on Github external
var request = require('superagent');
var Mustache = require('mustache');
var templateHelper = require('../template-helper');
var HttpStatus = require('http-status-codes');
var resumeToText = require('resume-to-text');
var resumeToMarkdown = require('resume-to-markdown');
var Pusher = require('pusher');
var pdf = require('pdfcrowd');
var client = new pdf.Pdfcrowd('thomasdavis', '7d2352eade77858f102032829a2ac64e');
var pusher = null;
if (process.env.PUSHER_KEY) {
    pusher = new Pusher({
        appId: '83846',
        key: process.env.PUSHER_KEY,
        secret: process.env.PUSHER_SECRET
    });
};
var realTimeViews = 0;
var DEFAULT_THEME = 'modern';
var Resume = require('../models/resume');

module.exports = function renderResume(req, res, err) {
    realTimeViews++;

    var redis = req.redis;
github jsonresume / registry-server / controller / renderResume.js View on Github external
.end(function(err, response) {
                    client.convertHtml(response.text, pdf.sendHttpResponse(res, null, uid + ".pdf"), {
                        use_print_media: "true"
                    });

                });
github jsonresume / registry-server / server.js View on Github external
.end(function(err, response) {
            client.convertHtml(response.text, pdf.sendHttpResponse(res), {
                use_print_media: "true"
            });
        });
});

pdfcrowd

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

MIT
Latest version published 23 days ago

Package Health Score

65 / 100
Full package analysis