Running without a license key
What NexPDF for Python does before a key is activated, how the watermark works, and how to evaluate every module with a trial key.
You do not need a key to install NexPDF, write code against it or run it. Until
nexpdf.activate_license succeeds, the SDK runs in view-only mode:
- the
viewermodule works: open, render, extract text, search and read document information; - pages rendered with
render_page_pngcarry a "NexPDF • Unlicensed" watermark; - every call that needs another module raises
nexpdf.NexPdfError.
import nexpdf
with nexpdf.Document.open("contract.pdf") as doc: # no activate_license call
print(nexpdf.license_status()["state"]) # "unlicensed"
png = doc.render_page_png(0, 144) # works, with the watermark
text = doc.extract_page_text(0) # works
try:
doc.rotate_page(0, 90) # needs the editor module
except nexpdf.NexPdfError as e:
print(e) # no license activated: 'editor' requires a NexPDF license keyWhat works without a key
| Area | Methods |
|---|---|
| Opening and saving | Document.open, Document.from_bytes, nexpdf.open_image, save, save_bytes, save_linearized, copy, insert_image_pages |
| Rendering | render_page_png, render_thumb_png, page_size, page_view_json, set_overprint (render_page_png output is watermarked) |
| Text | extract_page_text, extract_markdown, page_blocks_json, search_json, ask_document |
| Reading structure | metadata_json, outlines_json, page_labels_json, layers_json, set_layer_visible, attachments_json, attachment_data |
| Reading annotations | annotations_json, measurements_json |
| Security | security_json |
| Comparing and memory | compare_json, compare_overlay_png, trim_memory, memory_usage_bytes |
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
status = nexpdf.license_status()
if status["state"] == "unlicensed":
print("view-only mode, pages are watermarked")
elif status["state"] == "trial":
print(f"trial, {status['days_left']} days left")
else:
print("licensed for", ", ".join(status["modules"]))Use nexpdf.is_licensed("redaction") to hide features your key does not unlock instead of waiting
for the error.
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 activate_license 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.