Saves a webpage as PDF using Chrome's Puppeteer
npm install pierrecholhot/krldf
const krldf = require('krldf')
krldf({ url: 'https://www.google.com/' })
const krldf = require('krldf')
async function capture(opts) {
const path = await krldf(opts)
console.log(path ? 'success' : 'failure')
}
capture({ url: 'https://www.google.com/' })
./node_modules/krldf/cli.js --url="https://www.google.com/"
or via npx
npx krldf --url="https://www.google.com/"
npm install -g pierrecholhot/krldf
krldf --url="https://www.google.com/"
Type: string
Default: about:blank
⚙️ URL of the page to be converted. The url should include scheme, e.g. https://
Type: number
Default: 3000
⚙️ Number of ms
to wait before capture. Useful when waiting for authentication services
Type: number
Default: 2560
⚙️ Width of the capture viewport
Type: number
Default: 1440
⚙️ Height of the capture viewport
Type: string
Default: result.pdf
⚙️ The file path to save the PDF to. If path is a relative path, then it is resolved relative to current working directory.
Type: boolean
Default: false
⚙️ Enable paper landscape orientation
Type: string
Default:
⚙️ HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:
date
formatted print datetitle
document titleurl
document locationpageNumber
current page numbertotalPages
total pages in the document
Type: string
Default:
⚙️ HTML template for the print footer. Should be valid HTML markup with following classes used to inject printing values into them:
date
formatted print datetitle
document titleurl
document locationpageNumber
current page numbertotalPages
total pages in the document