Trial and licensing
Trial evaluation
Developers can request a trial through the Foxit Developer Hub to download and evaluate the Foxit PDF SDK trial version, or contact the Foxit technical support team and sales representatives. The trial edition has the same functionality as the standard licensed edition, with the following limitations:
- The trial period is 30 days.
- Generated PDF pages include a trial watermark.
After the trial period ends, contact the Foxit sales team to purchase a license if you wish to continue using Foxit PDF SDK.
WARNING
Without authorization from Foxit Software Incorporated, you may not distribute any documentation, sample code, or source code from the Foxit PDF SDK package to third parties.
License and initialize the SDK
Before calling any SDK API, your application must initialize the Foxit PDF SDK library with a valid license. Trial license files are located in the lib directory of the development package and include **_sn.txt and **_key.txt.
Initialization steps:
Obtain license credentials:
- The
snparameter value is the string after "SN=" in**_sn.txt. - The
keyparameter value is the string after "Sign=" in**_key.txt.
- The
Call the initialization function:
- Use the obtained
snandkeyvalues to callLibrary.initialize(sn, key)to initialize the SDK.
- Use the obtained
Before initializing the library, load the correct native library for your system. The following sample code automatically loads the correct library and initializes it:
java
// Load the library.
// You can also use System.load("filename") instead. The filename argument must be an absolute path name.
static {
String os = System.getProperty("os.name").toLowerCase();
String lib = "fsdk\_java\_";
if (os.startsWith("win")) {
lib += "win";
} else if (os.startsWith("mac")) {
lib += "mac";
} else {
lib += "linux";
}
if (System.getProperty("sun.arch.data.model").equals("64")) {
if(System.getProperty("os.arch").equals("aarch64")){
if(os.startsWith("mac")){
lib += "arm";
}
else{
lib += "armv8";
}
}
else{
lib += "64";
}
} else {
if(System.getProperty("os.arch").equals("arm")){
lib += "armv7";
}
else{
lib += "32";
}
}
System.loadLibrary(lib);
}
// Initialize the library.
// The value of "sn" can be got from "gsdk\_sn.txt" (the string after "SN=").
// The value of "key" can be got from "gsdk\_key.txt" (the string after "Sign=").
String sn = " ";
String key = " ";
int error\_code = Library.initialize(sn, key);
if (error\_code != *e\_ErrSuccess*)
return;
...go
package main
import (
. "foxit.com/fsdk"
)
// Define serial number and key
const (
sn = ""
key = ""
)
………
errCode := LibraryInitialize(sn, key)
if errCode != E_ErrSuccess {
return false
}