Skip to Content
NexPDF

Running without a license key

What NexPDF for .NET does before a key is activated, how the watermark works, and how to evaluate every module with a trial key.

English

You do not need a key to install NexPDF, write code against it or run it. Until NexPdfSdk.ActivateLicense succeeds, the SDK runs in view-only mode:

  • the viewer module works: open, render, extract text, search and read document information;
  • pages rendered with RenderPagePng carry a "NexPDF • Unlicensed" watermark;
  • every call that needs another module throws NexPdfException.
using Nexdevit.NexPdf;

using var doc = NexPdfDocument.Open("contract.pdf");    // no ActivateLicense call
Console.WriteLine(NexPdfSdk.LicenseStatusJson());       // {"state":"unlicensed",...}
var png = doc.RenderPagePng(0, 144);                     // works, with the watermark
var text = doc.ExtractPageText(0);                       // works

try
{
    doc.RotatePage(0, 90);                               // needs the editor module
}
catch (NexPdfException e)
{
    Console.WriteLine(e.Message);  // no license activated: 'editor' requires a NexPDF license key
}

What works without a key

AreaMembers
Opening and savingNexPdfDocument.Open, OpenBytes, OpenBytesWithPassword, OpenImage, Save, SaveBytes, SaveLinearized, Copy, InsertImagePages
RenderingRenderPagePng, RenderThumbPng, PageCount, PageWidth, PageHeight, PageViewJson, PageView, SetOverprint (RenderPagePng output is watermarked)
TextExtractPageText, ExtractMarkdown, ToMarkdown, PageBlocksJson, SearchJson, AskDocument, AskDocumentJson
Reading structureMetadataJson, OutlinesJson, PageLabelsJson, LayersJson, SetLayerVisible, AttachmentsJson, AttachmentData
Reading annotationsAnnotationsJson, MeasurementsJson
SecuritySecurityJson
Comparing and memoryCompareJson, CompareOverlayPng, CompareTextJson, CompareAnnotate, TrimMemory, MemoryUsageBytes
LibraryNexPdfSdk.Version, LicenseStatusJson, IsLicensed, HasBundledFonts, RegisterStandardFont

Everything else (annotating, filling forms, editing, encrypting, redacting, signing, converting, OCR and PDF/A) needs a key that includes the module. The API reference names the module of every method.

Check the mode at run time

using System.Text.Json.Nodes;

var status = JsonNode.Parse(NexPdfSdk.LicenseStatusJson())!;
switch (status["state"]!.GetValue<string>())
{
    case "unlicensed":
        Console.WriteLine("view-only mode, pages are watermarked");
        break;
    case "trial":
        Console.WriteLine($"trial, {status["days_left"]} days left");
        break;
    default:
        Console.WriteLine($"licensed for {status["modules"]!.ToJsonString()}");
        break;
}

Use NexPdfSdk.IsLicensed("redaction") to hide features your key does not unlock instead of waiting for the exception.

Evaluate with a trial key

A trial key unlocks every module so you can try annotations, signing, redaction and the rest. It keeps a "NexPDF • Trial" watermark on rendered pages, and ActivateLicense returns 1 instead of 2. Trial keys last 30 days; ask for one from the pricing page and activate it exactly like a commercial key; see License.

Do not ship view-only or trial builds

The watermark is drawn on the pixels of rendered pages only; documents you save are not changed. Even so, view-only and trial modes are for development and evaluation. Production apps need a commercial key for the modules they use. See Licensing and the modules per plan.

On this page