Converting bitmark HTML into PDF.
This library is made for the use with Node. Add it to your project by running $ npm install getmorebrain-bitmark-html-pdf-converter
or $ yarn add getmorebrain-bitmark-html-pdf-converter
. If you want to use this library as a standalone, simple download the repository. Run $ npm install
or $ yarn install
then to load the projects' dependencies.
The converter can be used via CLI by running $ bin/bitmark-json-to-html.js html:convert
.
It expects two arguments:
- The input file or stream with the bitmark HTML content.
- The output file where the PDF should be written to. If this argument is missing, the PDF will be displayed in the console.
So a conversion call could look like that:
$ bin/bitmark-json-to-html.js html:convert /path/to/input.html /path/to/output.pdf
The --css
option allows to add a custom stylesheet. This should be the path to an existing css
file. If not set, the default stylesheet will be used.
In case you want to use a custom HTML to PDF renderer, you can add its name or path with the --renderer
option. This can be for example vivliostyle
if this binary is available on your system, or a path like /usr/local/AHFormatterV72/run.sh
. Per default, the converter will use PagedJS, which is included with this library.
Currently supported renderers are:
- AH Formatter
- PagedJS
- Vivliostyle
Add the --help
option to see all available arguments and options.
If you have any questions, feel free to contact us under [email protected]
.
Further information about Bit&Black can be found under www.bitandblack.com.