TeX Engine

TeX Engine

TeXJob is the main entry point for the Aspose.TeX FOSS engine. It accepts an input source, an output device, and optional TeXOptions, then runs the typesetting pipeline.


Constructor

TeXJob(source: InputSource, device: OutputDevice, options: TeXOptions | None = None)
ParameterTypeDescription
sourceInputSourceFileInputSource or StringInputSource
deviceOutputDevicePdfDevice, DviDevice, or SvgDevice
optionsTeXOptionsEngine options; defaults to TeXOptions()

Running the Engine

Call run() to execute typesetting:

from aspose_tex import TeXJob, TeXOptions, PdfDevice, StringInputSource

job = TeXJob(StringInputSource("Hello!"), PdfDevice(), options=TeXOptions())
output_bytes = job.run()

The return value is bytes for PdfDevice and DviDevice. For SvgDevice, the return value is None; pages are retrieved with SvgDevice.get_all_pages().


TeXOptions

TeXOptions() configures the engine. Constructing it with no arguments uses standard TeX defaults, which are appropriate for most documents.


API Reference Summary

Class / MethodDescription
TeXJobMain engine entry point
TeXJob.run()Execute typesetting; return output bytes
TeXOptionsEngine configuration
PdfDevicePDF output device
DviDeviceDVI output device
SvgDeviceSVG output device
SvgDevice.get_all_pages()Return per-page SVG byte strings

See Also