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)| Parameter | Type | Description |
|---|---|---|
source | InputSource | FileInputSource or StringInputSource |
device | OutputDevice | PdfDevice, DviDevice, or SvgDevice |
options | TeXOptions | Engine 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 / Method | Description |
|---|---|
TeXJob | Main engine entry point |
TeXJob.run() | Execute typesetting; return output bytes |
TeXOptions | Engine configuration |
PdfDevice | PDF output device |
DviDevice | DVI output device |
SvgDevice | SVG output device |
SvgDevice.get_all_pages() | Return per-page SVG byte strings |