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 : Monday, February 13, 2017 5:01:16 PM(UTC)
Nick Villalobos

Groups: Registered, Manager, Tech Support, Administrators
Posts: 75

Was thanked: 2 time(s) in 2 post(s)

Below you will find a code snippet of how to set a runtime license using LEADTOOLS 19 Java SDK. The first step you will want to do is set your lib path to the location where the CDLLVC10 file are located, then load the necessary libraries needed for your application.

Once that is set, you can now call RasterSupport.setLicense(license path, developer key); Those two files should be located, by default, here for Windows: C:\LEADTOOLS 19\Common\License or emailed to you if you're working on Linux

Code:

public static boolean loadLibraries() {
		try {
			// Set the path to the libs

            //Windows
            Platform.setLibPath("C:\\LEADTOOLS 19\\Bin\\CDLLVC10\\x64"); 	
            
            //Linux
            Platform.setLibPath("<Path to the LEADTOOLS directory>/LEADTOOLS19/Bin/Lib/x64");
	
			// Load in the necessary libraries
			Platform.loadLibrary(LTLibrary.LEADTOOLS);
	        Platform.loadLibrary(LTLibrary.IMAGE_PROCESSING_CORE);
	        Platform.loadLibrary(LTLibrary.SVG);
	        Platform.loadLibrary(LTLibrary.PDF);
	        Platform.loadLibrary(LTLibrary.DOCUMENTS);
			
			String licensePath = "Path to the developer license file";
			String developerKey = "Developer key";
			
			// Set your license
			RasterSupport.setLicense(licensePath, developerKey);
			
			if(RasterSupport.getKernelExpired()) {
				System.out.println("License NOT Set Successfully");
				return false;
			}
			else {
				System.out.println("License Set Successfully");
				return true;
			}
		}
		catch(Exception ex) {
			ex.printStackTrace();
			return false;
		}
	}
Nick Villalobos
Developer 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-2017, Yet Another Forum.NET
This page was generated in 0.116 seconds.