omml2img
Node module for converting Office MathML objects to images in PNG, GIF and JPEG formats
Installation
Use npm
to install package
npm install omml2img
Usage
The usage of module is very simple. All you need is pass to a Promise-function named renderFromString
omml-text and options for renderer (optional). In then-method you will get the image data (if everything succes) or error in the catch-method. For example:
Options
There are few options that you can pass to a renderFromString
function in options
object:
tmp_dir
- Path to temporary directory. Default -files
in the module directoryencoding
- In which encoding image data will be returned. Default - utf8backgroundColor
- Background color of image file. Default - whitefontColor
- Font size uses in image file. Default - 40file_type
- File type for image. Default - pngremove_file
- Flag for a delete a temporary files. Default - true
Also are avaliabe two options for debugging:
debug
- Option to enable debug logging. Default - falsecolorize
- Option to colorize log output. Default - false
Dependencies & Requirements
The module uses JEuclid that work on Java. So Java must be installed on machine. The libraries and programms you must install too use module: