capture-pdf
Capture html in a pdf buffer
Install
$ npm install --save capture-pdf
Usage
const fs = ;const pdf = ; ; ; ; ;
API
pdf(input, [options])
input
Type: string
Specify some html, the path to an html file or a website.
options
delay
Type: number
(seconds)
Default: 0
Delay capturing the website. Useful when the site does things after load that you want to capture.
css
Type: string
Apply custom CSS to the webpage. Specify some CSS or the path to a CSS file.
paperSize
Type: object
Default: {format: 'A4', orientation: 'portrait', border: '1cm'}
Size of the web page.
header
Type: string
HTML that should be rendered at the top of every page. You can use {{pageNum}}
and {{numPages}}
to render the number of the page and the total number of pages in the header.
footer
Type: string
HTML that should be rendered at the bottom of every page. You can use {{pageNum}}
and {{numPages}}
to render the number of the page and the total number of pages in the footer.
License
MIT © Sam Verschueren