com.ironsoftware.ironpdf.License Maven / Gradle / Ivy
Show all versions of ironpdf Show documentation
package com.ironsoftware.ironpdf;
import com.ironsoftware.ironpdf.internal.staticapi.License_Api;
import com.ironsoftware.ironpdf.internal.staticapi.Setting_Api;
/**
* Allows developers to apply license keys for of IronPDF for Java
*/
public final class License {
/**
* Gets your current license key. Removes PDF watermarks.
* Get a free development license at https://ironpdf.com/licensing/#trial-license or purchase a deployment license from
* https://ironpdf.com/licensing/.
*
* @return the license key
*/
public static String getLicenseKey() {
return Setting_Api.licenseKey;
}
/**
* Sets your license key.
* ***Recommended to set license key before calling any IronPdf function.***
*
You will need to add a valid license key to perform any IronPdf operations beyond basic testing.
*
Adding a valid license key removes PDF watermarks and allows advanced functionality.
*
Get a free development license at https://ironpdf.com/licensing/#trial-license or purchase a deployment license from
* https://ironpdf.com/licensing/.
*
* @param licenseKey the license key
*/
public static void setLicenseKey(String licenseKey) {
Setting_Api.licenseKey = licenseKey;
License_Api.SetLicensed(licenseKey);
}
/**
* Determines whether this instance of IronPDF is Licensed. Will return false unless a {@link com.ironsoftware.ironpdf.License#setLicenseKey(String)}
* is set to a valid trial or full license key in IronPdf.License.LicenseKey,
* Web.Config , App.Config or appsettings.json in .Net Core.
* See https://ironpdf.com/licensing/ and https://ironpdf.com/docs/license/license-keys/
*
* @return True if the license key given is valid.
*/
public static boolean isLicensed() {
return License_Api.isLicensed();
}
/**
* Determines whether a string license key is valid. See https://ironpdf.com/licensing/ for trial,
* development and commercial deployment licensing options.
*
* @param licenseKey IronPDF license key as a string
* @return True if the license key given is valid.
*/
public static boolean isValidLicensed(String licenseKey) {
return License_Api.isValidLicensed(licenseKey);
}
}