0

MathMLから画像への変換後に出力画像の寸法を設定する方法を探しています。私は簡単なコードを書きました:

public static void main(String[] args) throws IOException {
    Converter converter = Converter.getInstance();
    converter.convert(new File("C:\\test.html"),
        new File("C:\\out.jpg"), "image/jpeg");
}

test.htmlは次のようになります。

<?xml version="1.0"?>
<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">
<math mode="display">
  <mrow>
    <munderover>
      <mo>&#x222B;</mo>
      <mn>1</mn>
      <mi>x</mi>
    </munderover>
    <mfrac>
      <mi>dt</mi>
      <mi>t</mi>
    </mfrac>
  </mrow>
 </math>

その結果、21x37pxの寸法の画像が得られます。私が何かを試した限り(しかしそれは機能しません):

MutableLayoutContext params = new LayoutContextImpl(
            LayoutContextImpl.getDefaultLayoutContext());
    params.setParameter(Parameter.?, ?);

私がこの次元を操作する方法を知っていますか?

4

1 に答える 1

0

I found a way, the param that helps here is:

params.setParameter(Parameter.MATHSIZE, 50f);
于 2013-03-13T13:16:31.490 に答える