breezy-pdf-lite-client
v0.0.2
Published
Javascript client for breezy-pdf-lite, an HTML -> PDF service powered by Google Chrome
Downloads
2
Readme
BreezyPDFLite
A javascript client for BreezyPDFLite, a one-click-to-deploy microservice for converting HTML to PDF with Google Chrome. Send the library a chunk of HTML, get a PDF of it back. Configure how the PDF is rendered via meta
tags in the HTML.
Use pragmatically, or as a Express.js Middleware (TODO).
Installation
$ yarn add breezy-pdf-lite-client
Usage
Pragmatic Usage
const BreezyPDFLite = require('breezy-pdf-lite-client')
const breezyPDFLite = new BreezyPDFLite({
baseUrl: 'https://YOURINSTANCEOFBREEZYPDFLITE.herokuapp.com',
secretApiKey: 'YOURSECRETAPIKEYFROMYOURINSTANCE'
})
await pdf = breezyPDFLite.render('<html>....</html>')
// Download as a file
const file = await pdf.toFile('path')
// Direct Readable Stream
const stream = pdf.stream()
stream.pipe(yourWritableStream)
License
See LICENSE
.