Troubleshooting
Fixes for the most common problems with NexPDF for .NET MAUI - missing native engines, XAML namespace, license and watermark issues, documents that do not open or refresh, fonts, signatures and OCR.
Building NexPdf.Maui for iOS or Mac Catalyst needs the engine in native/NexPdfCore.xcframework
next to the project. Unzip NexPdfCore.xcframework.zip from the release there, or point the build
at another folder:
dotnet build -f net10.0-ios -p:NexPdfNativeDir=/path/to/nexpdf-nativeThe folder can be given with or without a trailing slash. This check and native/ arrived in
1.0.1; see Installation.
Building for Android needs libnexpdf_ffi.so per ABI under native/android/jni/<abi>/. The AAR of
the release is a zip archive: extract its jni/ folder into native/android/, keeping the ABI
folder names (arm64-v8a, armeabi-v7a, x86_64).
The APK has no engine for the device's ABI. Emulators on Intel and AMD machines need x86_64, most
phones arm64-v8a. Check that the folder for that ABI is in native/android/jni/ and rebuild.
The Windows build does not stop when the DLL is missing; the app fails on the first NexPDF call
instead. Put nexpdf_ffi.dll (from nexpdf-ffi-<version>-windows-x64.zip) in
native/windows/, and check that it is copied next to the app. The release DLL is x64 only.
Use the namespace Nexdevit.NexPdf.Maui with the assembly NexPdf.Maui:
xmlns:nex="clr-namespace:Nexdevit.NexPdf.Maui;assembly=NexPdf.Maui"The 1.0.0 README showed clr-namespace:NexPdf.Maui, which does not resolve.
That is the 1.0.0 behaviour: the license was active, but Activate reported false for anything
but a trial key. Update to 1.0.1, or call NexPdfSdk.ActivateLicense instead. See
License.
Check what NexPdfSdk.LicenseStatusJson() returns on the device:
unlicensed: activation never ran, or it failed. Activate inMauiProgram.CreateMauiApp, before the first document opens, and logNexPdfEngine.LastErroror theNexPdfException.trial: trial keys always keep the "NexPDF • Trial" watermark.licensed: commercial keys render without a watermark. Pages rendered before activation stay in the view's cache; callReloadAsync()or load the document again.
The key must list the platform NexPdfEngine.Platform returns on the device: ios on iOS and Mac
Catalyst, android on Android, windows on Windows. The app id must be AppInfo.PackageName
character for character; if your iOS bundle id and Android package name differ, the key must list
both. You can change both in the dashboard and download a re-signed key.
The device clock is earlier than the key's issue date. This happens on devices with a wrong date; fix the clock and activate again.
The file is encrypted and the view had no password. Since 1.1, handle PasswordRequired, ask the
user, and set view.Password (which retries an open from DocumentBytes) or call
LoadAsync(bytes, password). e.WrongPassword tells a wrong password from a missing one. In 1.0.x
PdfView took no password: open the file yourself with NexPdfDocument.OpenBytes(data, password).
See Security.
The view keeps the pages it has rendered. Call await view.ReloadAsync() after every change to
Document, including showing or hiding a layer.
PdfView does not report rendering errors. Render the page yourself to see the engine's message:
try { view.Document!.RenderPagePng(page, 72); }
catch (NexPdfException e) { System.Diagnostics.Debug.WriteLine(e.Message); }The PDF uses a standard font (Helvetica, Times, Courier) without embedding it. The default build
bundles the Liberation fonts as substitutes. If NexPdfSdk.HasBundledFonts() returns 0, register
them yourself with NexPdfSdk.RegisterStandardFont(bytes) for each font file, before opening
documents.
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.
On phones and tablets the built-in engine (or a neural model you loaded) is the one that runs.
Tesseract is only used where the tesseract program is installed and on the PATH. See
OCR.
The built-in engine reads Latin-script text only. Load a detection model and a recognition model
for the script with NexPdfSdk.OcrLoadModel before calling Ocr, and pass matching languages.
NexPdfSdk.OcrModelsJson() 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 PdfView and most viewers do not lay out. Convert it with
view.Document!.XfaToAcroform() or XfaFlatten() and call ReloadAsync(); 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
NexPdfException message lists their clauses. Run ValidatePdfaJson(level) to see each failure
with its page and object. See PDF/A and PDF/UA validation.
Signing returns the complete signed file as a byte[]. Write those bytes to disk unchanged and show
them with LoadAsync. Calling Save() on the document afterwards rewrites the file and invalidates
the signature. See Signatures.
A document is held in memory as a whole, and the engine's caches of fonts and images are shared by
the whole app. Dispose the PdfView (which frees its document) and every NexPdfDocument you open
yourself when you no longer need them. See Platform notes.
Still stuck? Check Error handling for the meaning of each error, or the general FAQ.