Running without a license key
What NexPDF for .NET MAUI does before a key is activated, how the watermark works in PdfView, and how to evaluate every module with a trial key.
You do not need a key to install NexPDF, build your app or run it. Until a license is activated
(NexPdfEngine.Activate returns true, or NexPdfSdk.ActivateLicense returns), the SDK runs in
view-only mode:
- the
viewermodule works:PdfViewopens, scrolls and zooms documents, and the engine renders, extracts text, searches and reads document information; - every page
PdfViewshows, and every page rendered withRenderPagePng, carries a "NexPDF • Unlicensed" watermark; - every call that needs another module throws
NexPdfException.
using Nexdevit.NexPdf;
using Nexdevit.NexPdf.Maui;
await view.LoadAsync(pdfBytes); // works, pages are watermarked
var text = view.Document!.ExtractPageText(0); // works
try
{
view.Document.RotatePage(0, 90); // needs the editor module
}
catch (NexPdfException e)
{
System.Diagnostics.Debug.WriteLine(e.Message); // no license activated: 'editor' requires a NexPDF license key
}What works without a key
| Area | Members |
|---|---|
| Viewer | PdfView: LoadAsync, DocumentBytes, Password, ReloadAsync, GoToPageAsync, SetZoom, pinch and double-tap zoom |
| Opening and saving | NexPdfDocument.Open, OpenBytes, OpenBytesWithPassword, OpenImage, Save, SaveBytes, SaveLinearized, Copy, InsertImagePages |
| Rendering | RenderPagePng, RenderThumbPng, PageCount, PageWidth, PageHeight, PageViewJson, PageView, SetOverprint (RenderPagePng output is watermarked) |
| Text | ExtractPageText, ExtractMarkdown, ToMarkdown, PageBlocksJson, SearchJson, AskDocument, AskDocumentJson |
| Reading structure | MetadataJson, OutlinesJson, PageLabelsJson, LayersJson, SetLayerVisible, AttachmentsJson, AttachmentData |
| Reading annotations | AnnotationsJson, MeasurementsJson |
| Security | SecurityJson |
| Comparing and memory | CompareJson, CompareOverlayPng, CompareTextJson, CompareAnnotate, TrimMemory, MemoryUsageBytes |
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())!;
var state = status["state"]!.GetValue<string>(); // "unlicensed", "trial" or "licensed"
WatermarkNotice.IsVisible = state != "licensed";Use NexPdfSdk.IsLicensed("annotations") to hide buttons for 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 NexPdfSdk.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.