Diagnose assets, PDF files and configuration
JSON is awaited for up to five seconds. Network/HTTP errors, redirects, invalid JSON, array roots and invalid names fall back to standard PDF.js behavior. Search the console for [WT PDF.js user-config]. Invalid individual options do not prevent other accepted values from applying.
| Symptom | Check |
|---|---|
| Unknown asset | Installed/enabled plugin, code after registration, explicit registration in administrator pages. |
| pdfjsLib is undefined | Asset activated, consumer waits for the library, server/CSP allows .mjs. |
| Worker version mismatch | One build per window, matching library/worker, clear stale caches. |
| PDF will not open | Encoded file value, file exists, matching origin; endpoint returns PDF rather than login HTML. |
| JSON ignored | Network: correct URL and 200 JSON; lowercase .json, flat object, correct types; console warnings. |
| Different zoom | Check #zoom and viewOnLoad: fragments and document history affect startup. |
| Missing fonts/images | Matching cmaps, standard_fonts, wasm and iccs are available; paths account for subdirectories. |
| Unreadable code in dark Joomla | Use matching bg-body and text-body, without forced bg-white. |
Serve .mjs with a JavaScript MIME type. Open viewers over HTTP(S), not file://. Iframe sandbox restrictions on scripts or origin may prevent module/JSON loading. During troubleshooting, open the same viewer URL in a separate tab.