Last active
August 6, 2021 11:52
-
-
Save aspose-com-gists/36b5e72851c49250c8747cab3a94a381 to your computer and use it in GitHub Desktop.
Convert TeX Files to Images using C++ | https://blog.aspose.com/2021/08/06/convert-tex-files-to-images-using-cpp/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Read the complete article about converting TeX files to images using C++ by visiting the following link. | |
https://blog.aspose.com/2021/08/06/convert-tex-files-to-images-using-cpp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create typesetting options for default ObjectTeX format on ObjectTeX engine extension. | |
System::SharedPtr<TeXOptions> options = TeXOptions::ConsoleAppOptions(TeXConfig::ObjectTeX()); | |
// Specify a file system working directory for input. | |
options->set_InputWorkingDirectory(System::MakeObject<InputFileSystemDirectory>(u"SourceDirectory")); | |
// Specify a file system working directory for output. | |
options->set_OutputWorkingDirectory(System::MakeObject<OutputFileSystemDirectory>(u"OutputDirectory")); | |
// Specify console as output terminal. | |
options->set_TerminalOut(System::MakeObject<Aspose::TeX::IO::OutputConsoleTerminal>()); | |
// Default. No need to specify. | |
// Specify memory stream as output terminal, if you don't want terminal output to be written to console. | |
//options.TerminalOut = new OutputMemoryTerminal(); | |
// Set the save options | |
options->set_SaveOptions([&] { | |
auto tmp_0 = System::MakeObject<BmpSaveOptions>(); | |
tmp_0->set_Resolution(300); | |
return tmp_0; | |
}()); | |
// Run typesetting. | |
Aspose::TeX::TeX::Typeset(u"hello-world", System::MakeObject<ImageDevice>(), options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create typesetting options for default ObjectTeX format on ObjectTeX engine extension. | |
System::SharedPtr<TeXOptions> options = TeXOptions::ConsoleAppOptions(TeXConfig::ObjectTeX()); | |
// Specify a file system working directory for input. | |
options->set_InputWorkingDirectory(System::MakeObject<InputFileSystemDirectory>(u"SourceDirectory")); | |
// Specify a file system working directory for output. | |
options->set_OutputWorkingDirectory(System::MakeObject<OutputFileSystemDirectory>(u"OutputDirectory")); | |
// Specify console as output terminal. | |
options->set_TerminalOut(System::MakeObject<Aspose::TeX::IO::OutputConsoleTerminal>()); | |
// Default. No need to specify. | |
// Specify memory stream as output terminal, if you don't want terminal output to be written to console. | |
// options.TerminalOut = new OutputMemoryTerminal(); | |
// Set the save options | |
options->set_SaveOptions([&] { | |
auto tmp_0 = System::MakeObject<JpegSaveOptions>(); | |
tmp_0->set_Resolution(300); | |
return tmp_0; | |
}()); | |
// Run typesetting. | |
Aspose::TeX::TeX::Typeset(u"hello-world", System::MakeObject<ImageDevice>(), options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create typesetting options for default ObjectTeX format on ObjectTeX engine extension. | |
System::SharedPtr<TeXOptions> options = TeXOptions::ConsoleAppOptions(TeXConfig::ObjectTeX()); | |
// Specify a file system working directory for input. | |
options->set_InputWorkingDirectory(System::MakeObject<InputFileSystemDirectory>(u"SourceDirectory")); | |
// Specify a file system working directory for output. | |
options->set_OutputWorkingDirectory(System::MakeObject<OutputFileSystemDirectory>(u"OutputDirectory")); | |
// Specify console as output terminal. | |
options->set_TerminalOut(System::MakeObject<Aspose::TeX::IO::OutputConsoleTerminal>()); | |
// Default. No need to specify. | |
// Specify memory stream as output terminal, if you don't want terminal output to be written to console. | |
//options.TerminalOut = new OutputMemoryTerminal(); | |
// Set the save options | |
options->set_SaveOptions([&] { | |
auto tmp_0 = System::MakeObject<PngSaveOptions>(); | |
tmp_0->set_Resolution(300); | |
return tmp_0; | |
}()); | |
// Run typesetting. | |
Aspose::TeX::TeX::Typeset(u"hello-world", System::MakeObject<ImageDevice>(), options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create typesetting options for default ObjectTeX format on ObjectTeX engine extension. | |
System::SharedPtr<TeXOptions> options = TeXOptions::ConsoleAppOptions(TeXConfig::ObjectTeX()); | |
// Specify a file system working directory for input. | |
options->set_InputWorkingDirectory(System::MakeObject<InputFileSystemDirectory>(u"SourceDirectory")); | |
// Specify a file system working directory for output. | |
options->set_OutputWorkingDirectory(System::MakeObject<OutputFileSystemDirectory>(u"OutputDirectory")); | |
// Specify console as output terminal. | |
options->set_TerminalOut(System::MakeObject<Aspose::TeX::IO::OutputConsoleTerminal>()); | |
// Default. No need to specify. | |
// Specify memory stream as output terminal, if you don't want terminal output to be written to console. | |
//options.TerminalOut = new OutputMemoryTerminal(); | |
// Set the save options | |
options->set_SaveOptions([&] { | |
auto tmp_0 = System::MakeObject<TiffSaveOptions>(); | |
tmp_0->set_Resolution(300); | |
return tmp_0; | |
}()); | |
// Run typesetting. | |
Aspose::TeX::TeX::Typeset(u"hello-world", System::MakeObject<ImageDevice>(), options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment