0.9.18 • Published 5 years ago

runtemplate v0.9.18

Weekly downloads
21
License
MIT
Repository
github
Last release
5 years ago

runtemplate

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

Beta Version

PDF template editor that is designed non-techs. Renderer service is standalone.

runtemplate.com is the online pdf template editor.

Online Editor Features

  • Upload logo and images
  • Support markdown

Standalone Server Features

  • start microservice or middleware in your server
  • smartly cache template from cloud
  • render pdf in local microservice (work even network is disconnected)
  • Non-developers can edit via online editor and microservice will get updated
  • based on pdfmake and pdfkit

Usage

microservice

npm install --global runtemplate
runtemplate

middleware

import { pdfMiddleware } from 'runtemplate'

const response = await pdfMiddleware({
  method: request.method,
  path: request.path,
  query: request.query,
  reqBody: request.body,

  // optional
  saveOutput: async output => {
    cacheTable.set(output.code, output)
    return output
  },
  loadOutput: async ({ code }) => {
    return cacheTable.get(code).body
  },
})
// Use method=POST to generate pdf
// response.body = { url, code, ... }
// And http GET the response url

// if method=GET
// response.type = 'application/pdf'
// response.body = pdf stream

example http POST

http://localhost:8899/pdf/demo/new__Receipt-Number?auth=YOUR_AUTH_OR_EMPTY

{"data":{"number":"Receipt-Number","timeAt":"2019-02-18T15:31:08.067Z","items":[{"type":"Product","name":"A","quantity":1,"price":12},{"type":"Product","name":"B","quantity":1,"price":1}]}}'

example http GET

http://localhost:8899/pdf/demo/new__Receipt-Number?auth=YOUR_AUTH_OR_EMPTY
0.9.18

5 years ago

0.9.17

5 years ago

0.9.16

5 years ago

0.9.15

5 years ago

0.9.14

5 years ago

0.9.9

5 years ago

0.9.4

5 years ago

0.8.12

5 years ago

0.8.11

5 years ago

0.8.10

5 years ago

0.8.9

5 years ago

0.8.8

5 years ago

0.8.7

5 years ago

0.8.6

5 years ago

0.8.5

5 years ago

0.8.4

5 years ago

0.8.3

5 years ago

0.8.2

6 years ago

0.8.0

6 years ago