Namespace Aspose.TeX.Plugins
Namespace Aspose.TeX.Plugins
类
类名 | 描述 |
---|---|
FigureRendererPlugin | 图形渲染插件类。 |
FigureRendererPluginOptions | Aspose.TeX.Plugins.FigureRendererPlugin 的选项。 |
FigureRendererPluginResult | 图形渲染插件的通用结果。 |
MathRendererPlugin | 数学渲染插件类。 |
MathRendererPluginOptions | Aspose.TeX.Plugins.MathRendererPlugin 的选项。 |
MathRendererPluginResult | 数学渲染插件的通用结果。 |
PngFigureRendererPluginOptions | 图形渲染插件用于以 PNG 渲染 LaTeX 图形的选项。 |
PngMathRendererPluginOptions | 数学渲染插件用于以 PNG 渲染数学公式的选项。 |
ResultContainer | 插件执行结果容器。 |
StreamDataSource | 插件的加载和保存操作的流数据源。 |
StringDataSource | 插件的加载操作的字符串数据源。 |
SvgFigureRendererPluginOptions | 图形渲染插件用于以 SVG 渲染 LaTeX 图形的选项。 |
SvgMathRendererPluginOptions | 数学渲染插件用于以 SVG 渲染数学公式的选项。 |
接口
接口名 | 描述 |
---|---|
IDataSource | 通用数据源接口。 |
IOperationResult | 通用操作结果接口。 |
IPlugin | 通用插件接口。 |
IPluginOptions | 通用插件选项接口。 |
枚举
枚举名 | 描述 |
---|---|
DataType | 枚举插件 I/O 可用的数据类型。 |
示例
该示例演示如何以 PNG 渲染 LaTeX 片段。
// 创建图形渲染器。
FigureRendererPlugin renderer = new FigureRendererPlugin();
// 创建 PngFigureRendererPluginOptions 实例并设置选项。
PngFigureRendererPluginOptions options = new PngFigureRendererPluginOptions()
{
BackgroundColor = Color.Yellow,
Resolution = 150,
Margin = 10,
Preamble = "LaTeX preamble"
};
// 添加输入 LaTeX 片段。
options.AddInputDataSource(new StringDataSource("LaTeX fragment"));
// 创建一个流以将图像写入。
using (Stream stream = File.Open("output path", FileMode.Create))
{
// 添加输出流。
options.AddOutputDataTarget(new StreamDataSource(stream));
// 运行处理。
ResultContainer result = renderer.Process(options);
}
该示例演示如何以 PNG 渲染 LaTeX 公式。
// 创建数学渲染器。
MathRendererPlugin renderer = new MathRendererPlugin();
// 创建 PngMathRendererPluginOptions 实例并设置选项。
PngMathRendererPluginOptions options = new PngMathRendererPluginOptions()
{
BackgroundColor = Color.Yellow,
TextColor = Color.Blue,
Resolution = 150,
Margin = 10,
Preamble = "LaTeX preamble"
};
// 添加源公式。
options.AddInputDataSource(new StringDataSource("LaTeX formula"));
// 创建一个流以将图像写入。
using (Stream stream = File.Open("output path", FileMode.Create))
{
// 添加输出流。
options.AddOutputDataTarget(new StreamDataSource(stream));
// 运行处理。
ResultContainer result = renderer.Process(options);
}