Licensing Aspose.TeX API Solution

Get the license for Aspose.TeX from a file or stream with C++

 

While it is often referred to as a file format, TeX is a programming language used to write programs for a computer document preparation system which is also called TeX (the TeX engine). It is typicaly used to create of mathematical or technical documents.

When using the Aspose.TeX API in your own project, it is important to set the license for the components. The code snippets presented here show how to load the license from a stream or a file. To run the examples, you will need the Aspose.TeX for C++ API, a feature-rich and easy-to-use document manipulation and conversion tool for the C++ platform.

Here you will find examples of how to load licenses from a stream or from a file. But first, you will need to install the Aspose.TeX API. You can do it either by searching for it in the NuGet package manager or by using the Install-Package Aspose.TeX.Cpp command in the Package Manager Console.

Package Manager Console Command

PM> Install-Package Aspose.TeX.Cpp

This code describes loading the TeX license from a file. To do this, the next steps should be taken:

  1. Create an instance of the License class.
  2. Call the SetLicense() method of the license object passing the path to the license file License\Aspose.Total.C++.lic as an argument. This installs the license for the Aspose.TeX API from the specified file.
  3. Normally, you will get a message indicating that the license has been set successfully.

C++ code example: Loading license from a file

using Aspose::TeX;
using System;
// Initialize a license object
System::SharedPtr<License> license = System::MakeObject<License>();
// Set the license
license->SetLicense(u"License\\Aspose.Total.C++.lic");
System::Console::WriteLine(u"License set successfully.");

This code explains loading the TeX license from a stream. To do this, the next steps should be taken:

  1. Initialize a license object, which is an object of the License class.
  2. Then create a FileStream class instance containing the license data.
  3. Set license by calling the SetLicense() method passing the stream as an argument.

C# code example: Loading license from a stream

using Aspose::TeX;
using System;
using System::IO;
// Initialize a license object
System::SharedPtr<License> license = System::MakeObject<License>();
// Load the license in FileStream
System::SharedPtr<System::IO::FileStream> myStream = System::MakeObject<System::IO::FileStream>(u"License\\Aspose.Total.C++.lic", System::IO::FileMode::Open);
// Set the license
license->SetLicense(myStream);
System::Console::WriteLine(u"License set successfully.");



FAQ

1. What is the difference between TeX and LaTeX?

TeX is a programming language for a computer typesetting system, when LaTeX is the most common TeX format, or macro extension, which includes many useful tools for preparing publications.

2. How to load a TeX license?

To load a TeX license using this API Solution you need to Initialize license object by means of the License Class. Then set the license using the SetLicense() Method.

3. How to manage licenses with this API Solution?

To license the component use the entities of the License Class.

TeX What is TeX File Format

TeX is not actually a format. It is both a programming language and also an interpreter engine that understands this language. A TeX file is a plain text file created using TeX syntax to be converted to some target format by being processed by a TeX engine. This output document may include graphics, tables, lists, formulas, and equations.