2.0.20 • Published 7 years ago

pdfpy v2.0.20

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

HTML to PDF

Build Status npm version

Convert HTML to PDF simple and fast

sudo npm install pdfpy

Getting Started

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.

Installing

A step by step series of examples that tell you have to get a development env running

Install latest node and npm

Nodejs

Dependency

  • Python
  • pdfkit
  • simplejson

Require

var pdfpy = require('pdfpy');

Types (file and url)

//To generate pdf from file
pdfpy.file()
//To generate pdf from url
pdfpy.url()

Example

File

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")
});

URL

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")
});

Using Options

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")
});

Running the tests

npm test

Built With

pdfkit 0.6.1 python package

Authors

KiKe

License

This project is licensed under the MIT License - see the LICENSE.md file for details

2.0.20

7 years ago

2.0.19

7 years ago

2.0.18

7 years ago

2.0.17

7 years ago

2.0.16

7 years ago

2.0.15

7 years ago

2.0.14

7 years ago

2.0.12

7 years ago

2.0.11

7 years ago

2.0.10

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.0

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago