Licensing
Get a NexPDF license key, understand what it is bound to, activate it, and handle expiry, renewal and errors.
NexPDF uses offline license keys. A key is checked inside the SDK, on the device or server that runs your app, with no network call. Each key:
- is signed by NexPDF with an Ed25519 key and verified against the public keys compiled into the SDK;
- is bound to one or more platforms and to one or more application ids;
- has an expiry date and a set of unlocked modules.
Get a license key
Choose a plan
Pick a tier on the pricing page. The tier decides which modules the key unlocks and how many application ids it may bind.
Describe your app
In the dashboard, enter the licensee (the company or product that owns the license), the platforms you ship on, and the application id of each app (see the table below).
Download the license file
After payment the dashboard shows the key. Download it as the license XML file
(nexpdf_license.xml) or as the bare key. Every SDK accepts both.
Activate it at start-up
Call the SDK's activation function once per process, before any other NexPDF call. Each SDK's License page shows the exact code.
You can change the platforms and application ids of a paid license from the dashboard; the key is re-signed for the same paid period and you download the new file.
The license file
The license XML wraps the key with a readable summary. The SDK only reads the <key> element; the
other elements are for you.
<?xml version="1.0" encoding="UTF-8"?>
<license version="2">
<licensee>Acme, Lda</licensee>
<platform>android,ios</platform>
<apps>com.acme.reader</apps>
<starttime>2026-11-28</starttime>
<endtime>2027-12-12</endtime>
<type>offline</type>
<key>NEX2.…</key>
</license>The key itself is NEX2.<payload>.<signature>. Treat it like any other credential of your app: ship
it with the app or read it from your secret store, but do not publish it.
Platforms and application ids
A key works only on the platforms and for the application ids it was issued for.
| Platform | Application id the SDK checks | Typical activation |
|---|---|---|
android | The applicationId (package name) | NexPdfLicense.initialize(context) reads it from the app |
ios | The bundle id | NexPdf.activateLicense(xml) defaults to Bundle.main.bundleIdentifier |
web | The page host name; *.acme.com wildcards allowed | activateLicense(key, location.hostname) |
windows, macos, linux | Your desktop app id | activate_license(key, "linux", "com.acme.app") |
server | Your service id | activate_license(key, "server", "com.acme.api") |
Wildcard domains on the web
Web keys are bound to host names. A key for *.acme.com works on app.acme.com and
docs.acme.com. localhost is accepted as an application id for development keys. A bare *
(any app id) is available on Enterprise licenses only.
Server and desktop ids
For server, windows, macos and linux the application id is a name you choose (letters,
digits, ., _ and -), for example com.acme.invoicing. Pass the same string to the activation
call. The NexPDF WebViewer server and the Electron SDK read it from NEXPDF_APP_ID and default to
nexpdf-webviewer.
Without a license, and trial keys
| State | Modules | Rendered pages |
|---|---|---|
| No key, invalid or expired key | viewer only: open, render, search, extract text | Watermark "NexPDF • Unlicensed" |
| Trial key (30 days) | Every module | Watermark "NexPDF • Trial" |
| Commercial key | The modules of its tier | No watermark |
You can develop against the SDK with no key at all: viewing works and renders carry the watermark. For a 30-day trial key that unlocks every module, contact us from the pricing page.
A call that needs a module the license does not include fails with an error such as
no license activated: 'security' requires a NexPDF license key. In the C ABI the call returns 0
or NULL and sets nexpdf_last_error(); the language SDKs raise or return that message as an
error. The WebAssembly engine throws, and the web viewer server replies HTTP 402.
Expiry, renewal and the grace period
A commercial license is paid per year. The key's expiry date is the end of the paid year plus a 14-day grace period, so a renewal that is invoiced or paid a few days late never stops a running app. In the dashboard a license shows as:
- active until the end of the paid year;
- grace during the 14 days after it, while the key still works;
- expired after the grace period.
From NexPDF 1.1, a commercial key covers every SDK release made on or before its expiry date, for good. The SDK compares the key's expiry with its own release date, not with the device clock, so an app you shipped with a valid key keeps working after the key expires, whatever date the device shows. You renew to move to an SDK released after the expiry: such a release rejects the old key with "expired" (code -4). SDKs 1.0.x still compare the expiry with the device clock and fall back to the unlicensed state (viewer only, watermark) once it has passed.
Renew from the dashboard, or turn on automatic renewal. A renewal issues a new key with a new expiry date, so download the new license file and ship it with your next release (or update it in your secret store for server apps).
Trial keys are checked against the device clock: they stop working when the trial ends, and a device whose clock is set before the trial's start date reports "not yet valid" (code -5).
Checking the license at run time
Every SDK exposes the license state as JSON (licenseStatus, license_status_json and similar):
{
"state": "licensed",
"licensee": "Acme, Lda",
"id": "NXP-AB12-CDEF",
"tier": "business",
"modules": ["viewer", "annotations", "forms", "editor", "security", "conversion", "redaction", "signatures"],
"expires_at": 1828656000,
"days_left": 379,
"sdk_release": 1795910400,
"watermark": false
}sdk_release (from 1.1) is the release date of the SDK build, in Unix seconds: a commercial key
works with every build whose sdk_release is on or before expires_at.
Without a key the result is {"state":"unlicensed","modules":["viewer"],"watermark":true}. Most SDKs
also have an isLicensed(module) helper.
Error codes
Activation returns 2 for a commercial key and 1 for a trial key. Anything else is one of these
codes:
| Code | Meaning | What to check |
|---|---|---|
-1 | Malformed | The key or XML was truncated or edited. Pass the whole file or the whole NEX2. key. |
-2 | Bad signature | The key was not issued by NexPDF, or it was altered. |
-3 | Unsupported version | The key format is newer than this SDK. Update the SDK. |
-4 | Expired | A trial key whose trial has ended, or a commercial key older than this SDK release (the SDK was released after the key's expiry). Renew and activate the new key. |
-5 | Not yet valid | A trial key and a device clock earlier than the key's start date. |
-6 | Wrong platform | The platform you pass (or the SDK detects) is not in the key. |
-7 | Wrong application id | The bundle id, package name, host name or app id does not match the key. |
-8 | No license | No key was found (for example no nexpdf_license.xml in the Android assets). |
-9 | Module not licensed | A call needed a module the key does not include. |
Limits of offline keys
The check runs on the customer's device. Offline keys stop forged keys, the reuse of a key in another app or on another platform, and use after expiry. Like any offline license, they cannot stop someone who patches the binary.