@microfleet/html-to-pdf
Generates PDF files based on the HTML inputs and arbitrary data. Can be handy to create statements. Features integration with @microfleet/files for distributed storage and access control to such files
Last updated 8 months ago by avvs .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @microfleet/html-to-pdf 
SYNC missed versions from official npm registry.

@microfleet/html-to-pdf

Microfleet PDF

HTML to PDF @microfleet service is designed to render any provided mustache template with arbitrary context and is able to send back base64 encoded PDF or upload id in case of integration with @microfleet/files

Configuration

By default delayed-retry on Quality of Service is enabled, which effectively retries actions when unexpected errors occur up to 5 times by default with exponential delay.

API

Description of available API methods

pdf.render

Renders mustache template with passed context, feeds that document to Chrome & save it as PDF. Then uploads it to storage of choice using @microfleet/files or returns PDF as base64 encoded data

Following params are accepted:

{
  "template": "name-of-the-template-to-render",
  "context": {
    ... // arbitrary object with data thats passed to template for rendering
  },
  "documentOptions": {
    ... // chrome's printToPdf document options - https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF
  },
  "meta": {
    ... // can be boolean `false` to turn off @microfleet/files integration
    ... // or can be an object defining the upload
  },
}

For a detailed description of API params look at validation schema

Current Tags

  • 2.0.0                                ...           latest (8 months ago)

37 Versions

  • 2.0.0                                ...           8 months ago
  • 1.6.9                                ...           8 months ago
  • 1.6.8                                ...           9 months ago
  • 1.6.7                                ...           9 months ago
  • 1.6.6                                ...           9 months ago
  • 1.6.5                                ...           10 months ago
  • 1.6.4                                ...           10 months ago
  • 1.6.3                                ...           10 months ago
  • 1.6.2                                ...           10 months ago
  • 1.6.1                                ...           10 months ago
  • 1.6.0                                ...           10 months ago
  • 1.5.3                                ...           10 months ago
  • 1.5.2                                ...           a year ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.3                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.4                                ...           3 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (19)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |