Licensing Aspose.SVG for Python via .NET

You can install and test Aspose.SVG for Python via .NET before applying a license. For production workflows that must create unrestricted SVG, PDF, XPS, or image output, apply a license before processing documents.

Evaluation Version Limitations

The evaluation version exposes product features, but output may include evaluation restrictions. These limitations are useful for testing the API, but they should be removed before production use.

Common evaluation limitations include:

For a complete evaluation without these restrictions, request a 30-day temporary license.

Choose a Licensing Method

ScenarioMethod
Store a license as an application fileLoad a license file with License.set_license(path)
Read a license from application storageLoad a stream and pass it to License.set_license(stream)
Use consumption-based licensingApply public and private keys with Metered.set_metered_key()

Apply the license once during application startup, before creating, loading, saving, converting, rendering, or vectorizing SVG documents.

Apply a License from a File

Use the License class to apply a license file. The exact file name is not fixed; store the license under a path your application can read.

1from aspose.svg import License
2
3# Apply an Aspose.SVG license from a file
4license = License()
5license.set_license("./license/Aspose.SVG.Python.via.NET.lic")
6
7print("License set successfully.")

If your application runs from different working directories, use an absolute path or build the path explicitly with os.path.join().

Apply a License from a Stream

A stream-based license workflow is useful when the license file is embedded, downloaded securely, or loaded from application storage.

1from aspose.svg import License
2
3# Apply an Aspose.SVG license from a stream
4license = License()
5
6with open("./license/Aspose.SVG.Python.via.NET.lic", "rb") as license_stream:
7    license.set_license(license_stream)

Apply a Metered License

Metered licensing uses public and private keys instead of a license file. Use this option when your purchase model is based on metered usage.

1from aspose.svg import Metered
2
3# Apply a metered license with public and private keys
4metered = Metered()
5
6public_key = "your-public-key"
7private_key = "your-private-key"
8
9metered.set_metered_key(public_key, private_key)

For more details about this licensing model, see the Metered Licensing FAQ.

Use Multiple Aspose Products

If your application uses several Aspose products, apply a license for each product separately. Each product API needs its own license setup call.

For example, use the Aspose.SVG license class for SVG workflows and the license class of another Aspose product for that product’s workflows. This avoids ambiguity when multiple packages are loaded in the same application.

Common Mistakes and Fixes

ProblemLikely causeFix
Evaluation watermark appearsLicense was not applied or was applied too lateApply the license before processing documents
License file is not foundRelative path is resolved from a different working directoryUse an absolute path or build the path explicitly
License works locally but fails on a serverDeployment does not include the license fileAdd the license file to deployment secrets or application storage
Metered license does not activatePublic/private keys are missing or swappedVerify both keys and call set_metered_key(public_key, private_key)
Multiple products still show evaluation limitsLicense was applied only for one productApply the appropriate license setup for each Aspose product used

FAQ

Can I try Aspose.SVG for Python via .NET before buying?

Yes. You can use the evaluation version or request a temporary license for full testing.

When should I apply the license?

Apply the license at application startup, before loading, saving, converting, rendering, or vectorizing documents.

Does the license file need a fixed name?

No. You can rename the license file and pass the correct path to set_license().

Can I use a stream instead of a file path?

Yes. Load the license file as a stream and pass it to set_license().

What is a metered license?

A metered license uses public and private keys and is intended for usage-based licensing scenarios.

Related Articles