🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

html-pdf

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-pdf - npm Package Compare versions

Comparing version

to
0.1.1

2

lib/index.js

@@ -49,3 +49,3 @@ var fs, path, phantomjs, script, spawn;

if (isFile = /^\%PDF/.test(file.slice(0, 4).toString())) {
return callback(void 0, file);
return callback(null, file);
} else {

@@ -52,0 +52,0 @@ filename = file.toString();

{
"name": "html-pdf",
"version": "0.1.0",
"version": "0.1.1",
"description": "HTML to PDF converter that uses phantomjs",

@@ -5,0 +5,0 @@ "main": "index.js",

# node-html-pdf
## a HTML to PDF converter for node.js
## a HTML to PDF converter that wraps phantomjs
![image](http://public.admintools.ch/gh/html-pdf/businesscard.png)

@@ -19,1 +19,20 @@ [Example Business Card](http://public.admintools.ch/gh/html-pdf/businesscard.pdf)

```
## API
Currently there is only one function
```javascript
var pdf = require('html-pdf');
var callback = function(err, buffer){}
pdf.create(htmlString, options, callback)
```
## Options
`script`: Absolute path to a custom phantomjs script, use the file in lib/scripts as example
`timeout`: Timeout that will cancel phantomjs, milliseconds as Integer, default: 10000
`filename`: The file path of the file that will be written. If you want to save the file permanently, you have to pass this option.
`directory`: The directory path of the file that will be written. default: '/tmp'
The full options object gets converted to JSON and will get passed to the phantomjs script as third argument.
There are more options concerning the paperSize, header & footer options inside the phantomjs script.
Documentation will follow soon.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet