I am running into an issue where Javascript is not running inside of PDFs I upload onto my nextcloud instance.
I SSHd into my instance and ensured that scripting was permitted via the following command as is noted on PDF Viewer Github:
php occ config:app:set files_pdfviewer enable_scripting --value=yes
I have also logged in via Adminer and verified that the “YES” flag is enabled on the PDF Viewer app within the database.
I’ve ensured that Javascript is enabled on my browsers, verified both Firefox and Chrome, latest versions each.
I’ve emptied the cache of both browsers, I have also disabled all extensions and plugins. I also tried Firefox in Troubleshooting mode.
Regardless everytime I open the PDF, the PDF loads but the Javascript does not, so all my dynamic PDFs do not function.
When I open up the console in Firefox via F12, I see that the console prints the following warning:
File info for /EQUIPMENT-FILLABLE.pdf fetched
Object { filename: "/EQUIPMENT-FILLABLE.pdf", basename: "EQUIPMENT-FILLABLE.pdf", lastmod: "Sun, 27 Apr 2025 16:03:29 GMT", size: 351269, type: 1, etag: "0a3c290dafb83a28469df15b2833d542", mime: "application/pdf", tags: "", getcontentlength: 351269, getcontenttype: "application/pdf", … }
Viewer.vue:639
Content-Security-Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.
Content-Security-Policy warnings 2
Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. files_pdfviewer
PDF d34a55d7b2012e46a54268e789c800ce [1.7 pdf-lib (https://github.com/Hopding/pdf-lib) / Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/127.0.0.0 Safari/537.36] (PDF.js: 4.0.189 [50f52b43a]) app.js:1502:12
Warning: Unimplemented border style: inset util.js:367:12
Warning: Unimplemented border style: inset 15 util.js:367:12
Warning: JavaScript support is not enabled app.js:1462:14
However when I open up the same identical PDF at the following demo page, the PDF javascript runs correctly:
I am unsure what else to check or what could be blocking the Javascript from executing.
Thank you very much.
NEXTCLOUD VERSION
Nextcloud Hub 10 (31.0.4)
PDF VIEWER APP:
Version 4.0.0
DATABASE
Type: mysql
Version: 10.11.11
Size: 12,1 MB
PHP
Version: 8.2.28
Memory limit: 512 MB
Max execution time: 3600
Upload max size: 8 MB
OPcache Revalidate Frequency: 30
Extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, json, random, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, bcmath, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, imagick, imap, intl, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache