using Aspose.TeX.IO; using Aspose.TeX.Presentation.Image; using Aspose.TeX; // Load the source TeX file. byte[] bytes = File.ReadAllBytes("./sample.tex"); Stream stream = new MemoryStream(bytes); // Invoke the ConsoleAppOptions method and pass the ObjectLaTeX as a parameter. TeXOptions texOptions = TeXOptions.ConsoleAppOptions(TeXConfig.ObjectLaTeX); // Define the file system working directory for the output. texOptions.OutputWorkingDirectory = new OutputFileSystemDirectory("./files"); // Create an instance of the BmpSaveOptions class. texOptions.SaveOptions = new BmpSaveOptions(); // Initialize the object of the TeXJob class and call the Run method to convert TeX to BMP. new TeXJob(stream, new ImageDevice(), texOptions).Run();