@protacon/html-to-pdf
v1.1.3
Published
Simple tool to convert HTML content to PDF
Downloads
5
Readme
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
# 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
Copyright (c) 2017 Protacon Solutions Ltd