Example to use:
import fmath.components.MathMLFormula;
ApplicationConfiguration.setFolderUrlForFonts(mainFolder+"/fonts");
ApplicationConfiguration.setFolderUrlForGlyphs(mainFolder+"/glyphs");
...
// for mathml
MathMLFormula formula = new MathMLFormula();
BufferedImage img = formula.drawImage(mathml);
ImageIO.write(img, "png", fileName);
...
// for latex
MathMLFormula formula = new MathMLFormula();
String mathml = fmath.conversion.ConvertFromLatexToMathML.convertToMathML(latex);
BufferedImage img = formula.drawImage(mathml);
ImageIO.write(img, "png", fileName);
...
// for omml , read a word file
MathMLFormula formula = new MathMLFormula();
String mathml = fmath.conversion.ConvertFromWordToMathML.getMathMLFromDocFile(wordFilePath);
BufferedImage img = formula.drawImage(mathml);
ImageIO.write(img, "png", fileName);
...
// for omml , generate a word file
fmath.conversion.ConvertFromMathMLToWord.writeWordDocStreamFromMathML(OutputStream out, String mathml);
...
Dependency: jdom-2.0.6.jar
|