https://github.com/duderman/omml2img
Node module for converting Office MathML objects to images
https://github.com/duderman/omml2img
Last synced: 5 months ago
JSON representation
Node module for converting Office MathML objects to images
- Host: GitHub
- URL: https://github.com/duderman/omml2img
- Owner: duderman
- License: mit
- Created: 2013-08-29T11:39:01.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-08-26T09:28:30.000Z (almost 10 years ago)
- Last Synced: 2025-09-29T08:00:28.867Z (9 months ago)
- Language: XSLT
- Size: 5.6 MB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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:
```javascript
require('omml2img').renderFromString(string_with_omml, {file_type: 'jpeg', encoding: 'base64' })
.then(function (image) {
console.log('OK! The image is', image.data);
})
.catch(function (err) {
console.error('Oops :(', err);
);
```
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 directory
* `encoding` - In which encoding image data will be returned. Default - utf8
* `backgroundColor` - Background color of image file. Default - white
* `fontColor` - Font size uses in image file. Default - 40
* `file_type` - File type for image. Default - png
* `remove_file` - Flag for a delete a temporary files. Default - true
Also are avaliabe two options for debugging:
* `debug` - Option to enable debug logging. Default - false
* `colorize` - Option to colorize log output. Default - false
Dependencies & Requirements
--------
The module uses [JEuclid](http://jeuclid.sourceforge.net/) that work on Java. So Java must be installed on machine.
The libraries and programms you must install too use module:
* [Python](http://www.python.org/)