Licensing and evaluation

Aspose.PDF for C++ can be evaluated before purchase. The evaluation documentation describes watermarked output and a limit of four processed items per collection.

Request a temporary license when you need to evaluate without these restrictions. See pricing and purchase options for commercial licensing.

Apply a license from a file

  1. Create a License object.
  2. Call SetLicense() with the license path before processing PDFs.
#include <Aspose.PDF.Cpp/License.h>
#include <system/string.h>

void ApplyLicense(System::String licenseFile)
{
    auto license = System::MakeObject<Aspose::Pdf::License>();
    license->SetLicense(licenseFile);
}

Apply a license from a stream

Open the license file as a readable stream and pass it to SetLicense().

#include <Aspose.PDF.Cpp/License.h>
#include <system/io/file.h>
#include <system/io/file_stream.h>
#include <system/string.h>

void ApplyLicenseFromStream(System::String licenseFile)
{
    auto stream = System::IO::File::OpenRead(licenseFile);
    auto license = System::MakeObject<Aspose::Pdf::License>();
    license->SetLicense(stream);
    stream->Close();
}

Use an explicit path to avoid relying on working-directory lookup. Use the same initialization for a purchased or temporary license.