Troubleshooting
Fixes for the most common problems with NexPDF for Python - the native library not loading, license and watermark issues, fonts, signatures and OCR.
The package found no native engine. The message lists every path it tried. Either install a platform
wheel that has the library in nexpdf/lib/, or point the SDK at the file:
export NEXPDF_LIB_PATH=/opt/nexpdf/lib/libnexpdf_ffi.soCheck the file matches your Python's architecture (python -c "import platform; print(platform.machine())"):
an arm64 library does not load in an x86_64 interpreter. See Installation.
Files downloaded with a browser get the quarantine attribute. Remove it from the library you extracted:
xattr -d com.apple.quarantine /opt/nexpdf/lib/libnexpdf_ffi.dylibThe Linux release libraries are built on Ubuntu 22.04 (glibc 2.35) and can fail to load on older systems. Use a newer base
image (for example python:3.12-slim, based on Debian 12) or distribution. There is no musl build,
so Alpine images need a glibc-based image instead.
Check what nexpdf.license_status() returns in the process that renders:
unlicensed:activate_licensewas never called in this process, or it raised. Activate it at start-up in every worker process (for example in each Gunicorn or Celery worker).trial: trial keys always keep the "NexPDF • Trial" watermark.licensed: commercial keys render without a watermark. If you still see one, it is an old render served from a cache.
The key does not list the platform (-6) or application id (-7) you passed. On servers use
platform server and the app id registered for the license, character for character. You can change
both in the dashboard and download a re-signed key.
The machine's clock is earlier than the key's issue date. Fix the clock (NTP) and activate again.
Your plan does not include that module. See Modules and tiers for which
plan unlocks it, and use nexpdf.is_licensed("xyz") to hide the feature.
The PDF uses a standard font (Helvetica, Times, Courier) without embedding it. The default build
bundles the Liberation fonts as substitutes. If nexpdf.has_bundled_fonts() returns 0, register
them yourself:
for path in ["LiberationSans-Regular.ttf", "LiberationSerif-Regular.ttf", "LiberationMono-Regular.ttf"]:
with open(path, "rb") as f:
nexpdf.register_standard_font(f.read())The page is a scanned image with no text layer. Run OCR first; it adds an invisible text layer that extraction and search then read.
Signing returns the complete signed file. Write those bytes to disk unchanged. Calling doc.save()
afterwards rewrites the file and invalidates the signature. See
Signatures.
With "engine": "auto", Tesseract is used only when the tesseract program is on PATH and has
data for every requested language. Check with tesseract --list-langs, or pass
"engine": "tesseract" to get an error instead of the fallback.
The built-in engine reads Latin-script text only. Load a detection model and a recognition model
for the script with nexpdf.ocr_load_model before calling ocr, and pass matching languages.
nexpdf.ocr_models_json() lists what is loaded; the report's engine says neural (<name>) when a
model was used. See OCR.
The file is a dynamic XFA form, which most viewers no longer lay out. Convert it with
xfa_to_acroform() or xfa_flatten(); see XFA forms. Scripts in
the form (FormCalc, JavaScript) are not run.
The document was converted as far as possible, but some PDF/A rules still fail; the error lists
their clauses. Run validate_pdfa_json(level) to see each failure with its page and object. See
PDF/A and PDF/UA validation.
Close every document (use with). Documents that stay open for a long time can call
trim_memory() after large operations. See Compare and optimise.
Still stuck? Check Error handling for the meaning of each error, or the general FAQ.