Documentation

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Wiris Integrations

                        • Home
                        • MathFlow
                        • MathFlow SDK for Developers
                        • Composition (Java and Windows)
                        • Composition: Equation Composer
                        • Composition: Equation Composer

                        Using the API in your program

                        Reading time: 1min

                        Follow the general steps below to use the Equation Composer in your program.

                        Setting the License

                        Before an equation image can be rendered, a valid MathFlow SDK license for the Equation Composer must be supplied to the EquationComposer class (note that this is available in 32- and 64-bit versions for Windows). This is accomplished by using the SetLicense method and passing in either the path and file name of a FlexNet license or the license string for a Design Science key.

                        Specifying the Input

                        To pass a MathML string to be rendered into the Equation Composer, use the SetMathML method. For a MathML file containing math markup, pass the path and file name into the LoadMathML method.

                        Defining the Output

                        The methods that define where the equation image will generated and what type of image it will be are:

                        • SetImageName
                        • SetImageType
                        • SetImageFolder

                        Setting Rendering Options

                        The methods that determine how an equation will be rendered are:

                        • SetPointSize
                        • SetDPI
                        • SetForeground
                        • SetBackground
                        • SetBreakWidth (Java only)
                        • SetPadding (Java only)
                        • SetUseAntialias

                        Using Fonts

                        Java

                        Use this method to select which font mapping file is used (see Java Rendering Engine for more information):

                        • SetFontMapping

                        Windows

                        Use these methods to select which fonts are used (see Windows Font Configuration for more information):

                        • SetFontConfig
                        • SetFontInfo
                        • SetBaseFont

                        When the EquationComposer DLL (note that this is available in 32- and 64-bit versions for Windows) is first loaded, it looks for the font configuration file and the font info file. If either file is present, it is used in the same way as the analogous configuration file passed via the -fontinfo or -fontconfig parameter by the command line component.

                        Saving Your Options

                        At any point in your program, you can save the options you have defined using SaveOptions. To load options previously saved, you would use ReadOptions.

                        Generating an Image File

                        Once the parameters have been set, an equation image can be generated with the GenerateImageFile method. In addition, with the Java version of the Equation Composer, it is possible to generate and return an equation image to the calling program by using the GenerateImageData method or to render an equation for the current MathML with the PaintEquation method. (Background transparency is currently implemented only for the GenerateImageFile method.)

                        Getting Image Information

                        The following methods are used to retrieve information about the equation image that was generated:

                        • GetAscent
                        • GetHeight
                        • GetWidth
                        • GetBaseline
                        • GetBreakWidth
                        • GetLineMetrics

                        Getting Additional Information

                        Use the GetLastMessage method to obtain the latest message string and ClearLastMessage to reset it. The SetVerbosity method specifies the amount of information that will appear in processing messages. These will be displayed to the console unless they are redirected to a log file with the SetLogFile method.

                        Was this article helpful?

                        Yes
                        No
                        Give feedback about this article

                        Related Articles

                        • Structure Editor application
                        • Integrate
                        • WirisQuizzes in your assessment system

                        Using the API in your program

                        Setting the License Specifying the Input Defining the Output Setting Rendering Options Using Fonts Java Windows Saving Your Options Generating an Image File Getting Image Information Getting Additional Information

                        Making people’s STEM work more meaningful

                        MathType

                        • MathType for Office Tools
                        • MathType for Mac
                        • MathType for Microsoft 365
                        • MathType for Google Workspace
                        • MathType for LMS
                        • MathType for XML Editors
                        • Arabic notation
                        • Our products accessibility
                        • MathType is online

                        WirisQuizzes

                        Learning Lemur

                        Solutions for Education

                        • Blackboard Learn
                        • Brightspace by D2L
                        • Canvas
                        • Google Classroom
                        • Moodle
                        • Schoology

                        Solutions for Publishing Houses

                        Solutions for Technical Writers

                        Solutions for Chemistry

                        Integrations

                        • HTML Editors
                        • MathType in WordPress

                        Pricing

                        Company

                        Careers

                        Blog

                        Contact Us

                        Buy Now

                        Plugin Downloads

                        © Wiris 2025

                        • Cookie Settings
                        • Cookie Policy
                        • Terms of Use
                        • Privacy Policy / GDPR
                        • Student Data Privacy
                        • Compliance
                        • Powered by Helpjuice
                        Expand