html-to-pdf
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
$ npm install
$ yarn install
Usage
Command line
See help
$ npm run convert
$ node bin/convert
Creating example file
$ npm run convert -- src/examples/example.html example.pdf --data '{"title": "Awesome", "content": "Lorem ipsum dolor."}'
$ 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