Skip to content

bhanuc/urltopdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#urltopdf

Converts webpages to pdf ( A wrapper on wkhtmltopdf)

Usage:

var urltopdf = require('urltopdf');
urltopdf.topdf( url, output, option-object, callback)

//Example ->
urltopdf.topdf('https://regrob.com/', 'null.pdf', {'page-size': 'A3'}, function(err,std){ 
	if(err){
		console.log(err);
		//handle error
	} else {
		console.log(1)
		console.log(std, std.output);
		//handle the printed pdf
	}
});

For full list of supported options visit - http://wkhtmltopdf.org/usage/wkhtmltopdf.txt

For full list of supported page size visit - http://qt-project.org/doc/qt-4.8/qprinter.html#PaperSize-enum

#Installation:

npm install urltopdf

#Test:

mocha

#API err is an object with follwing attributes

stack: Node.js stack which also has the error

code: error code

signal: error signal

killed: process killed boolean value

stderr: Actual error returned

#Author:

Bhanu Pratap Chaudhary

#Version History

0.0.1 - First release , minimal tests

About

Converts webpages to pdf ( A wrapper on wkhtmltopdf )

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published