I am using python 3.11.14 with spire-xls 15.7.1 (installed via pip).
I tried setting the license in two ways: via the xml file provided via email, and via the license key directly (contained in the xml file).
- Code: Select all
from spire.xls import LicenseProvider as xlsLicense
# method A: using the XML file
from spire.xls import LicenseProvider as xlsLicense
xlsLicense.SetLicenseFileName("/path/to/license.xml")
xlsLicense.LoadLicense()
# method B: using the key directly
spire_license_key = "my_key_string_here"
xlsLicense.SetLicenseKey(spire_license_key)
No exception is raised using either method. However, I note that *after* registering the license, my Python code which extracts chart images (using SaveChartAsImage) fails, with the exception `Failed to extract chart 0 from sheet 0: Format_BadBase64Char: at System.Convert.FromBase64CharPtr(Char*, Int32) + 0xb6`. When I use the same code, but without registering the license, the same Python code (using the same input file) extracts chart images successfully, but the images contain the Spire "Evaluation Warning" watermark.
Is this a problem with how I am registering the license? Could there be a bug in the SaveChartAsImage code path? Is there a way to "check" that a license has been properly validated?