danielwestendorf / breezy-pdf-lite-client-js

Javascript client for breezy-pdf-lite, an HTML -> PDF service powered by Google Chrome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

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.

About

Javascript client for breezy-pdf-lite, an HTML -> PDF service powered by Google Chrome

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%