Aspose.TeX and Object TeX
Object TeX
Now let’s consider the output format.
The original TeX was capable of outputting files in DVI (DeVice Independent) format only. It happened that the DVI format doesn’t define metrics of a media on which a file is going to be printed — the page size and the position of the upper-left corner of the entire page content. Once we decide to make the TeX engine capable of outputting files, say, in PDF format, we need to define such metrics. Thus, we need to include new primitives into original TeX engine’s set. And this would be an extension of the engine itself.
That’s what Object TeX is. Again, on the one hand, it’s a programming language with VirTeX’s set of primitives, expanded with new primitives imposed by new output requirements. On the other hand, it’s an extended TeX engine that understands new primitives as well. And, on the third hand, Object TeX is a new typesetting system in whole.
There’s the fourth hand. The Object TeX format is also a format based on Plain TeX that contains definitions that involve new primitives, e.g., assign default values to media metrics.
Aspose.TeX
And Aspose.TeX is just an API to the Object TeX system.
Why the new TeX is Object?
So why did we use “Object” in the name of the system? The reason is that the actual output of the Object TeX engine is not a file in the output format, but some intermediate object model, which is then transformed into a target format.
Native engine limitations vs. managed flexibility
When transitioning from traditional, command-line TeX distributions (such as TeX Live or MiKTeX) to a managed .NET library like Aspose.TeX, developers face a fundamental shift from file-system-bound, process-driven execution to a flexible, object-oriented architecture.
Here is a comparison of native engine limitations with the managed flexibility offered by Aspose.TeX, structured for technical documentation and developer guides.
- File system and I/O architecture
Native TeX limitations:
- Traditional TeX engines (like pdfTeX or XeTeX) are coupled to the local file system. They expect file paths pointing to physical directories on disk.
- Executing native processes on a server often requires granting read/write permissions across multiple system paths, opening up vulnerabilities if untrusted
.texinput tries to traverse directories or access restricted system files. - Feeding dynamic or database-stored LaTeX content into a native TeX engine requires writing temporary files to disk first, creating unnecessary I/O overhead and cleanup complexity.
Aspose.TeX managed flexibility:
- Aspose.TeX separates the engine from physical disk paths using the
IInputWorkingDirectoryandIOutputWorkingDirectoryinterfaces. - Developers can seamlessly read from and write to Memory Streams, ZIP archives, or custom data sources without touching the local disk.
- Error handling and server execution
Native TeX limitations:
- If a traditional TeX compiler faces a missing font, an undefined macro, or a syntax error, it doesn’t just crash—it often pauses execution and drops into an interactive prompt. This causes background web applications or worker services to hang indefinitely.
Aspose.TeX managed flexibility:
- Running entirely within the .NET runtime, Aspose.TeX reports compilation issues and missing dependency errors through the
TeXJobResultvalue returned byTeXJob.Run(), with the details written to the transcript (.log) and the output terminal. - With the
Interactionoption set toNonstopModeorBatchMode, a job does not wait for user input, so cloud functions, microservices, and background worker queues can handle malformed documents gracefully, log errors, and return appropriate HTTP status codes or error messages without locking up server threads.
- Concurrency and thread safety
Native TeX limitations:
- Standard CLI tools are designed for single-instance, sequential execution. Running multiple concurrent instances requires spinning up separate OS-level processes, which is computationally expensive and hard to scale under high loads.
Aspose.TeX managed flexibility:
- Because Aspose.TeX encapsulates typesetting jobs within isolated
TeXJobandTeXOptionsobject instances, developers can process multiple documents concurrently across multi-threaded .NET environments (subject to standard object-instance thread isolation rules).