1.0.4 • Published 4 years ago

node-htmlpdf v1.0.4

Weekly downloads
3
License
MIT
Repository
-
Last release
4 years ago

#node-htmlpdf

Converts Html file or buffer to Pdf using headless Browser

#Installation

npm i node-htmlpdf

#Example

const htmlpdf =require('node-htmlpdf')

let html =`<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>Hello world</h1>
    <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Culpa odit veritatis dolor enim quia deleniti aut minus magni beatae. Sit atque rem vitae alias recusandae fugit sed aliquam nihil illo.</p>
</body>
</html>`
node-htmlpdf.create(
    html,
    {path:'./test.pdf',
    format:'A4'},
    null).then((buff)=>{
    console.log(buff)
});

#Options

Path : "Path to create Pdf file" format: A4, letter landscape: Bool (true , false), height: Height of Pdf width: width of Pdf margin: top, left , botton right

License

MIT Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

1.0.2

4 years ago

1.0.1

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago