0.6.11 • Published 7 years ago

ibill v0.6.11

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

ibill

https://img.shields.io/npm/v/ibill.svg state npm npm

render PDF templates that your customers can edit via https://ibill.today server

Features

  • Support offline mode, in which, still can render even ibill.today server is down (template should be cached)
  • Your (multi-tenancy) customers can use our self-serve editor to edit, upload image and preview template
  • Support browser PDF rendering
  • based on pdfmake and pdfkit

Usage

CLI server

npm install --global ibill
ibill

example node.js server

import http from 'http'
import { renderPdf } from 'ibill'

http.createServer((req, res) => {
  renderPdf({
    templateId: 'my-template-id',
    data,
  }).then(pdfStream => {
    res.statusCode = 200
    res.setHeader('Content-Type', 'application/pdf')
    pdfStream.pipe(res)
  })
}).listen(8899, '0.0.0.0')

example koa server

import Koa from 'koa'
import { renderPdf } from 'ibill'

const app = new Koa()
app.use(async ctx => {
  const pdfStream = await renderPdf({ templateId: 'my-template-id', data })
  ctx.type = 'application/pdf'
  ctx.body = pdfStream
})

app.listen(8899, '0.0.0.0')
0.6.11

7 years ago

0.6.10

7 years ago

0.6.9

7 years ago

0.6.8

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.5

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago