Aspose.Page的许可| Aspose.Page 提供 C++

评估aspose.page

您可以轻松下载aspose.page for C ++进行评估。评估下载与购买的下载相同。当您添加几行代码以申请许可证时,评估版本才会获得许可。

Aspose的评估版本。C++(未指定许可证)的页面提供了完整的产品功能。但是,它施加以下限制:

如果您想在没有评估版本限制的情况下测试aspose.page。请参阅 如何获得临时许可?

申请许可证

可以通过为.lic文件提供明确的路径来应用许可证。您可以使用 许可证。设置方法来许可API。

何时申请许可证

遵循以下简单规则:

使用文件或流对象应用许可证

致电许可证多次是有害的,而只是浪费处理器时间。 如果您正在开发Windows应用程序,请在使用Aspose.page类之前在启动代码中调用许可证。

从文件中加载许可证

在此示例中,C ++的页面试图从显式文件路径中查找/设置许可证。

 1System::SharedPtr<License> license = System::MakeObject<License>();
 2
 3// This line attempts to set a license from several locations relative to the executable and Aspose.Words.dll.
 4// You can also use the additional overload to load a license from a stream, this is useful for instance when the
 5// license is stored as an embedded resource
 6try
 7{
 8    license->SetLicense(u"Aspose.Words.Cpp.lic");
 9    std::cout << "License set successfully." << std::endl;
10}
11catch (System::Exception& e)
12{
13    // We do not ship any license with this example, visit the Aspose site to obtain either a temporary or permanent license.
14    std::cout << "There was an error setting the license: " << e->get_Message().ToUtf8String() << std::endl;
15}

从流对象加载许可证

从流来初始化许可证

 1System::SharedPtr<License> license = System::MakeObject<License>();
 2
 3try
 4{
 5    // Initializes a license from a stream
 6    System::SharedPtr<System::IO::MemoryStream> stream = System::MakeObject<System::IO::MemoryStream>(System::IO::File::ReadAllBytes(u"Aspose.Words.Cpp.lic"));
 7    license->SetLicense(stream);
 8    std::cout << "License set successfully." << std::endl;
 9}
10catch (System::Exception& e)
11{
12    // We do not ship any license with this example, visit the Aspose site to obtain either a temporary or permanent license.
13    std::cout << "There was an error setting the license: " << e->get_Message().ToUtf8String() << std::endl;
14}

您可以更改许可证文件名

许可证文件名不必为’aspose.page.cpp.lic’。您可以将其重命名为您喜欢的任何东西,并在应用程序中设置许可证时使用该名称。

例外找不到许可证文件名

购买和下载许可证时,Aspose网站将许可证文件命名为“ Aspose.page.lic”。您使用浏览器下载许可证文件。一些浏览器将许可证文件识别为XML并将.xml扩展程序附加到其上,以便计算机上的文件的全名变为’aspose.page.page.lic.xml’。

当Microsoft Windows配置为隐藏已知文件类型的扩展(不幸的是,在大多数Windows安装中默认是默认情况下)时,许可证文件将显示为’aspose.page。 Windows Explorer中的LIC’。您可能会认为这是真实的文件名和呼叫许可。设置将其传递给“ Aspose.page.lic”,但是没有此类文件,因此例外。

要解决问题,请重命名文件以删除Invisible .xml扩展名。我们还建议您在Microsoft Windows中禁用“隐藏扩展”选项

使用aspose的多个产品

Have any questions about Aspose.Page?



Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.