Signed License Support - Alternative to License File

Does Aspose.PDF for .NET support signed licenses?

For example, instead of using a physical license file:
license.SetLicense(“path/to/file.lic”);

Can I use a signed license string directly in code like:
license.SetLicense(“Aspose.Pdf.License, Type=Developer, Hash=…, Company=…, Signature=…”);

@sarvictor87000

Cause

Aspose.PDF for .NET does not support using a signed license string directly in the code. The licensing mechanism requires a physical license file or a stream to set the license.

Solution

You can continue using the traditional approach by loading the license from a file or a stream. Here’s how you can do it:

  1. Using a License File:

    License license = new License();
    license.SetLicense("path/to/your/license/file.lic");
    
  2. Using a Stream:

    using (FileStream stream = new FileStream("path/to/your/license/file.lic", FileMode.Open))
    {
        License license = new License();
        license.SetLicense(stream);
    }
    

Code

Here’s a complete example of setting the license using a file:

using Aspose.Pdf;

class Program
{
    static void Main()
    {
        License license = new License();
        license.SetLicense("path/to/your/license/file.lic");

        // Your PDF processing code here
    }
}

Next Steps

If you have further questions or need assistance with a specific implementation, please ask! I am here to help you resolve any issues you may encounter.

Thank you for your inquiry!