in.mark(length + 1);
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
Source source = new StreamSource(in);
SAXMathBuilder mathBuilder = new SAXMathBuilder();
SAXResult res = new SAXResult(mathBuilder);
transformer.transform(source, res);
String fontname = "Helvetica";
int fontstyle = 0;
int displayfontsize = 12;
int inlinefontsize = 12;
if (mathBuilder.getMathRootElement() == null) {
//not a MathML document
try {
in.reset();
} catch (IOException ioe) {
log.error("Error while resetting ImageInputStream", ioe);
}
return null;
}
final MathBase base = new MathBase(
mathBuilder.getMathRootElement(),
fontname, fontstyle, inlinefontsize,
displayfontsize);
ImageInfo info = new ImageInfo(uri, "text/mathml");
final ImageSize size = new ImageSize();