Skip to content

Richienb/pdfly

Repository files navigation

pdfly Travis CI Build Status

Generate a pdf from html.

NPM Badge

Install

npm install pdfly

Usage

const { promises: fs } = require("fs")
const pdfly = require(".")

const html = await fs.readFile("file.html", "utf8")
const pdf = await pdfly(html)

await fs.writeFile("output.pdf", pdf)

API

pdfly(html, options?)

html

Type: string

The html to generate the pdf from.

options

Type: object

Options to pass to puppeteer.