@protacon/html-to-pdf

1.1.3 • Public • Published

html-to-pdf

MIT licensed Build Status codecov Dependency Status devDependency Status

What is this?

Simple tool to convert HTML content to PDF

Installation, configure and usage

Preconditions

First of all you have to install npm and node.js to your box - note that NodeJS 6+ is required. See following links to help you with installation:

Installation

First of all you have to install npm and node.js to your box. Installation instructions can be found here.

Note that node.js 6.x is required.

$ git clone https://github.com/ProtaconSolutions/html-to-pdf.git
$ cd html-to-pdf

# install the project's dependencies
$ npm install

# fast install (via Yarn, https://yarnpkg.com)
$ yarn install  # or yarn

Usage

Command line

See help

$ npm run convert
# OR
$ node bin/convert

Creating example file

$ npm run convert -- src/examples/example.html example.pdf --data '{"title": "Awesome", "content": "Lorem ipsum dolor."}'
# OR
$ node bin/convert src/examples/example.html example.pdf --data '{"title": "Awesome", "content": "Lorem ipsum dolor."}'

Web UI

Start server

$ npm start

Then open your http://localhost:3000/ within your favorite browser.

Translators

Translators are way to make embedded dataconversions to templates.

data: { barcode: '[translate:type]value'}

barcode

Translates textual content as barcode. Output is base64 encoded image string.

data: { barcode: '[translate:barcode]AE5C9B'}

Can be embedded to template HTML:

<img src="{{ barcode }}"/>

API

Author

Protacon Solutions Ltd

License

The MIT License (MIT)

Copyright (c) 2017 Protacon Solutions Ltd

Readme

Keywords

Package Sidebar

Install

npm i @protacon/html-to-pdf

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

46.3 kB

Total Files

20

Last publish

Collaborators

  • tarvainen
  • nevant
  • ptcs_seppo_storage
  • tarlepp
  • savpek
  • eerikkuoppala