Licensing | Aspose.PUB for C++

Evaluation Version Limitations**

The evaluation version of Aspose.PUB (without a license specified) provides full product functionality except that an evaluation version warning is displayed at the top of the converted document.

Apply License using File or Stream Object**

The license can be loaded from a file or stream object. Aspose.PUB for C++ will try to find the license in the following locations:

  1. Explicit path.
  2. The folder that contains Aspose.PUB.dll.
  3. The folder that contains the assembly that called Aspose.PUB.dll.
  4. The folder that contains the entry assembly (your .exe).
  5. An embedded resource in the assembly that called Aspose.PUB.dll.

The easiest way to set a license is to put the license file in the same folder as the Aspose.PDF.dll file and specify the file name, without a path, as shown in the example below.

Loading a License from File**

The easiest way to apply a license is to put the license file in the same folder as the Aspose.PUB.dll file and specify just the file name without a path.

When you call the SetLicense method, the license name that you pass should be that of the license file. For example, if you change the license file name to “Aspose.PUB.lic.xml” pass that file name to the Pdf->SetLicense(…) method.

C++

1    auto lic = MakeObject<Aspose::Pdf::License>();
2
3    lic->SetLicense(L"Aspose.PUB.Cpp.lic");

Loading a License from a Stream Object**

The following example shows how to load a license from a stream.

C++

1    intrusive_ptr<License>license = new License();
2
3    intrusive_ptr<FileStream> myStream = new FileStream(new String("Aspose.PUB.Cpp.lic"), FileMode_Open);
4
5    license->SetLicense(myStream);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.