Class MathRendererPlugin
Namespace: Aspose.TeX.Plugins
Assembly: Aspose.TeX.dll
MathRenderer plugin class.
ตัวอย่างแสดงวิธีการเรนเดอร์สูตร LaTeX เป็น PNG.
// Create MathRenderer.
MathRendererPlugin renderer = new MathRendererPlugin();
// Create the PngMathRendererPluginOptions instance and set up options.
PngMathRendererPluginOptions options = new PngMathRendererPluginOptions()
{
BackgroundColor = Color.Yellow,
TextColor = Color.Blue,
Resolution = 150,
Margin = 10,
Preamble = "LaTeX preamble"
};
// Add a source formula.
options.AddInputDataSource(new StringDataSource("LaTeX formula"));
// Create a stream to write the image to.
using (Stream stream = File.Open("output path", FileMode.Create))
{
// Add an output stream.
options.AddOutputDataTarget(new StreamDataSource(stream));
// Run the process.
ResultContainer result = renderer.Process(options);
}
public class MathRendererPlugin : IPlugin, IDisposable
Inheritance
Implements
Inherited Members
object.GetType(),
object.MemberwiseClone(),
object.ToString(),
object.Equals(object?),
object.Equals(object?, object?),
object.ReferenceEquals(object?, object?),
object.GetHashCode()
Constructors
MathRendererPlugin()
public MathRendererPlugin()
Methods
Dispose()
Disposes this instance.
ทำลายอินสแตนซ์นี้.
public void Dispose()
Process(IPluginOptions)
Runs Math Renderer processing with the specified parameters.
ดำเนินการประมวลผล Math Renderer ด้วยพารามิเตอร์ที่กำหนด.
public ResultContainer Process(IPluginOptions options)
Parameters
options
IPluginOptions
An options object containing instructions for the MathRenderer.
อ็อบเจ็กต์ตัวเลือกที่มีคำแนะนำสำหรับ MathRenderer.
Returns
An ResultContainer object containing the result of the operation.
อ็อบเจ็กต์ ResultContainer ที่มีผลลัพธ์ของการดำเนินการ.
Exceptions
When given options instance is null or has inappropriate type,
or one of the input/output sources has unsupported type.
เมื่ออินสแตนซ์ตัวเลือกที่ให้มาคือ null หรือมีประเภทที่ไม่เหมาะสม,
หรือหนึ่งในแหล่งข้อมูลนำเข้า/ส่งออกมีประเภทที่ไม่รองรับ.