This package has been deprecated

    Author message:

    this package has been deprecated

    ibill

    0.6.11 • Public • Published

    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')

    Install

    npm i ibill

    DownloadsWeekly Downloads

    2

    Version

    0.6.11

    License

    MIT

    Unpacked Size

    239 kB

    Total Files

    10

    Last publish

    Collaborators

    • ericfong