Convert HTML to PDF simple and fast
sudo npm install pdfpy
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
A step by step series of examples that tell you have to get a development env running
- Python
- pdfkit
- simplejson
var pdfpy = require('pdfpy');
//To generate pdf from file pdfpy.file()
//To generate pdf from url pdfpy.url()
var pdfpy = require('pdfpy'); var data = { //the key as to be same as below input: "./test.html", output: "./output.pdf" } pdfpy.file(data, function(err, res) { if(err) throw err if(res) console.log("success") });
var pdfpy = require('pdfpy'); var data = { //the key as to be same as below input: "http://google.com", output: "./output.pdf" } pdfpy.url(data, function(err, res) { if(err) throw err if(res) console.log("success") });
var pdfpy = require('pdfpy'); var data = { //the key as to be same as below input: "./test.html", output: "./output.pdf", options: { 'page-size': 'Letter', 'margin-top': '0.75in', 'margin-right': '0.75in', 'margin-bottom': '0.75in', 'margin-left': '0.75in', } } pdfpy.file(data, function(err, res) { if(err) throw err if(res) console.log("success") });
npm testpdfkit 0.6.1 python package
This project is licensed under the MIT License - see the LICENSE.md file for details