Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, March 6, 2018 12:06:58 PM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

An updated tutorial for setting a JavaScript license can be found here: https://www.leadtools.co...s-and-set-a-license.html

LEADTOOLS v19 and Earlier
The LEADTOOLS HTML5/JS files use a license file like the other binaries we provide in order to unlock LEADTOOLS features. With LEADTOOLS 18 and LEADTOOLS 19, the Leadtools.js by default would look for the LeadtoolsLicense.txt file in a LEADTOOLS directory from the root of the application folder. The directory location could be changed by setting lt.LTHelper.licenseDirectory, but the name of the file still has to be LeadtoolsLicense.txt. There also isn't any way to reference the text file from another machine. It has to reside in a directory accessible by the web server hosting the application.

LEADTOOLS v20+
With LEADTOOLS 20 and beyond, the license can now be set using RasterSupport.setLicenseUri(). This method will allow developers to not only set a license file from a common location (as might be needed with cloud applications), but it also will let developers specify the name of the file since the file will be downloaded by the browser. This method also includes a callback so if you wanted to run additional code after the license check has occurred you can do so.

Here is some sample code illustrating setLicenseUri:
Code:

if (lt.RasterSupport.kernelExpired) {
   lt.RasterSupport.setLicenseUri("http://localhost/SetLicenseTest/data/myLic.txt", function() {  
      if (!lt.RasterSupport.kernelExpired) 
         lt.LTHelper.log("LEADTOOLS client license set successfully"); 
      else
         lt.LTHelper.log("LEADTOOLS client license not set"); 
   }); 
}

Note that the web server where the license file is hosted must support the MIME type being requested.

To set the license directly, use lt.RasterSupport.setLicenseText(). The value to pass in for this is the actual contents of the leadtoolslicense.txt file. Note no callback is available when setting the license in this manner.
https://www.leadtools.com/help/leadtools/v20/dh/javascript/l/rastersupport-setlicensetext.html

Edited by moderator Wednesday, December 27, 2023 1:16:18 PM(UTC)  | Reason: Updating layout, adding more information

Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.055 seconds.