0.0.2 • Published 6 years ago

breezy-pdf-lite-client v0.0.2

Weekly downloads
3
License
GNUv3
Repository
github
Last release
6 years ago

BreezyPDFLite

Build Status Coverage Status

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.