FigureRendererPlugin class

FigureRendererPlugin class

The Figure Renderer plugin class.

The example shows how to render a LaTeX fragment in PNG.

from aspose.pydrawing import Color
from aspose.tex.plugins import FigureRendererPlugin, PngFigureRendererPluginOptions, StreamDataSource, StringDataSource

#  Create the Figure Renderer.
renderer = FigureRendererPlugin()
options = PngFigureRendererPluginOptions()
options.background_color = Color.yellow
options.resolution = 150
options.margin = 10.0
options.preamble = "LaTeX preamble"

#  Create the PngFigureRendererPluginOptions instance and set up options.
options = options
#  Add an input LaTeX fragment.
options.add_input_data_source(StringDataSource("LaTeX fragment"))
#  Create a stream to write the image to.
with open("output path", "wb") as stream:
    #  Add an output stream.
    options.add_output_data_target(StreamDataSource(stream))
    #  Run the process.
    result = renderer.process(options)

The FigureRendererPlugin type exposes the following members:

Constructors

ConstructorDescription
initConstructs a new instance of FigureRendererPlugin

Methods

MethodDescription
processRuns Figure Renderer processing with the specified parameters.

See Also