How to add and use a license key for UWP apps
Nutrient UWP SDK is a commercial product and uses a license key to verify your copy against the package name you registered.
Alternatively, you can initialize the SDK in trial mode without a license.
Generating the license key
To use a Nutrient license with your app, you have to generate a license key and bind it to the applicationId
bundle ID of your app.
-
Log in to the Nutrient Portal using the credentials you received when purchasing Nutrient. You’ll see the list of all your purchased licenses.
-
Locate your license (e.g. Nutrient UWP SDK) and click the Assign license key button next to it. A dialog will open.
-
Enter the bundle ID of your production app. If you’re unsure about this step, read our What Is a Bundle ID? guide first.
-
Click next and confirm your selected bundle ID. Double-check that the chosen identifier matches the one configured in your app, as it can no longer be changed once it’s been set.
Getting the license key
-
Log in to the Nutrient Portal using the credentials you received when purchasing Nutrient. You’ll see the list of all your purchased licenses.
-
Locate your license (e.g. Nutrient UWP SDK) and click the License Key button next to it. If there is no such button, you probably need to generate the license key first.
-
A dialog will open showing you a code snippet with your license key.
-
After copying the license key over to your project, the Nutrient SDK will be ready to use.
Adding the license key
This can be done either when initializing a PdfView
, or through the Sdk.Initialize
method, and it only needs to be set once after the application starts.
In XAML, when integrating the PdfView
control, you can use its License
property like so:
xmlns:pspdfkit="using:PSPDFKit.UI"
<pspdfkit:PdfView License="YOUR_LICENSE_HERE" ... />
In C#, use Sdk.Initialize
:
PSPDFKit.Sdk.Initialize("YOUR_LICENSE_HERE");
The initialization call placement depends on your application’s structure, but you must make sure that it’s called before any PdfView
s are loaded in or any model-only methods are used.
Trial mode
For the trial experience, you can initialize the SDK without a license. This can be done by either omitting the License
property of the PdfView
in XAML, or through the manual call:
xmlns:pspdfkit="using:PSPDFKit.UI" <ui:PdfView />
PSPDFKit.Sdk.Initialize();
More information on trying out Nutrient UWP SDK, including a get started guide, can be found on our trial page.