> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/core/learn-more/license.md).

# Add a License Key to Apryse Server SDK

Learn how to get a production license for PDFNet SDK and troubleshoot common licensing issues. Contact sales for a license key and optimize your application without elevated rights. The Apryse Server

## Getting a production license

Now that you’ve built your application, and tested it in a deployment environment, you might be ready to purchase a license. Please [contact sales](https://apryse.com/form/contact-sales) in order to get a license key.

## Using the license

{% hint style="info" %}
**Run Apryse SDK in production**

A commercial license key is required for use in a production environment. Please [contact sales](https://apryse.com/form/contact-sales) to purchase a commercial key or if you need any other license key assistance.
{% endhint %}

{% hint style="warning" %}
**Keep your commercial license key confidential.**

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
{% endhint %}

Your license key may be used to initialize PDFNet in the following manner:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
pdftron.PDFNet.Initialize("Insert trial key or commercial license key here after purchase");
```

{% endcode %}
{% endtab %}

{% tab title="C++" %}
{% code lineNumbers="true" %}

```cpp
PDFNet::Initialize("Insert trial key or commercial license key here after purchase");
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code lineNumbers="true" %}

```go
PDFNetInitialize("Insert trial key or commercial license key here after purchase")
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
PDFNet.initialize("Insert trial key or commercial license key here after purchase");
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
PDFNet.runWithCleanup(callback, "Insert trial key or commercial license key here after purchase");
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
PDFNet.initialize(applicationContext, R.raw.pdfnet, "Insert trial key or commercial license key here after purchase")
```

{% endcode %}
{% endtab %}

{% tab title="Obj-C" %}
{% code lineNumbers="true" %}

```objc
[PTPDFNet Initialize:@"Insert trial key or commercial license key here after purchase"];
```

{% endcode %}
{% endtab %}

{% tab title="Swift" %}
{% code lineNumbers="true" %}

```swift
PTPDFNet.initialize("Insert commercial license key here after purchase")
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
PDFNet::Initialize("Insert commercial license key here after purchase");
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
PDFNet.Initialize("Insert commercial license key here after purchase")
```

{% endcode %}
{% endtab %}

{% tab title="Ruby" %}
{% code lineNumbers="true" %}

```ruby
PDFNet.Initialize("Insert commercial license key here after purchase")
```

{% endcode %}
{% endtab %}

{% tab title="VB" %}
{% code lineNumbers="true" %}

```vb
PDFNet.Initialize("Insert commercial license key here after purchase")
```

{% endcode %}
{% endtab %}
{% endtabs %}

Initializing PDFNet with the license key will also remove the requirement to run your demo application with elevated rights in a server environment.

If you are in `demo/trial mode`, a license key is `NOT` required. You can initialize PDFNet in the following manner:

{% tabs %}
{% tab title="C#" %}
{% code lineNumbers="true" %}

```csharp
pdftron.PDFNet.Initialize();
```

{% endcode %}
{% endtab %}

{% tab title="C++" %}
{% code lineNumbers="true" %}

```cpp
PDFNet::Initialize();
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code lineNumbers="true" %}

```go
PDFNetInitialize()
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
PDFNet.initialize();
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
PDFNet.initialize();
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
PDFNet.initialize(applicationContext, R.raw.pdfnet, "")
```

{% endcode %}
{% endtab %}

{% tab title="Obj-C" %}
{% code lineNumbers="true" %}

```objc
[PTPDFNet Initialize: 0];
```

{% endcode %}
{% endtab %}

{% tab title="Swift" %}
{% code lineNumbers="true" %}

```swift
PTPDFNet.initialize("")
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}
{% code lineNumbers="true" %}

```php
PDFNet::Initialize();
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code lineNumbers="true" %}

```python
PDFNet.Initialize()
```

{% endcode %}
{% endtab %}

{% tab title="Ruby" %}
{% code lineNumbers="true" %}

```ruby
PDFNet.Initialize()
```

{% endcode %}
{% endtab %}

{% tab title="VB" %}
{% code lineNumbers="true" %}

```vb
PDFNet.Initialize()
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Common questions

**Error:** Bad License Key. PDFNet SDK will work in the demo mode. For more information please see PDFNet FAQ or contact `support@apryse.com`.

**Solution:** The license key was copied incorrectly. First, make sure no extra white space was added to the beginning or end of the string. Finally, make sure you are copying the entire license key as it was sent to you.

**Error:** Your AMS expired on.... To upgrade to this version of PDFNet SDK, please renew your AMS subscription.

**Solution:** Your license is out of date and cannot use newer versions of PDFNet. Either return to using an earlier version, or [contact sales](https://apryse.com/legal) to renew.

[Exception when using license key](https://groups.google.com/forum/?fromgroups#!topic/pdfnet-sdk/m2b0pSHl3EA) - Issue thread on the PDFNet SDK forum.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/core/learn-more/license.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
