How to load the UniOffice license key?
UniOffice licenses can only be loaded via code. The package used to load the UniOffice license is github.com/unidoc/unioffice/common/license.
As of now, UniOffice license loading via environment variables is not supported.
To following play illustrates the license key loading for UniOffice. Make sure the key is separated the same way as mentioned in the below example
package main import ( "fmt" "github.com/unidoc/unioffice/common/license" ) // Example of an offline perpetual license key. const offlineLicenseKey = ` -----BEGIN UNIDOC LICENSE KEY----- contents here. -----END UNIDOC LICENSE KEY----- ` func init() { // The customer name needs to match the entry that is embedded in the signed key. customerName := `My Company` // Good to load the license key in `init`. Needs to be done prior to using the library, otherwise operations // will result in an error. err := license.SetLicenseKey(offlineLicenseKey, customerName) if err != nil { panic(err) } } func main() { lk := license.GetLicenseKey() if lk == nil { fmt.Printf("Failed retrieving license key") return } fmt.Printf("License: %s\n", lk.ToString()) }