PDF Viewer - Does not work externally

I can view PDFs from Files. When I try to access the same file via the shared link, I receive an error. This error occurs in Incognito, on another device, in other browsers on my computer, and even in the same browser as my logged-in Nextcloud session.

The error in Edge is:

PDF.js v2.4.456 (build: 228a591c)
Message: Failed to fetch

The error in Firefox is:

PDF.js v2.4.456 (build: 228a591c)
Message: NetworkError when attempting to fetch resource.

We are running Nextcloud 20.0.7.

Same for me.

I can open pdf file in Files

but if I open same file via shared link, there is an error

PDF.js v2.4.456 (build: 228a591c)
Message: Invalid PDF structure.

Nextcloud 20.0.7

Same here after Upgrade to NC 20.0.7

Error trying to open shared PDF-Files:
PDF.js v2.4.456 (build: 228a591c)
Message: Invalid PDF structure.

Here also similar error message after upgrade to NC 20.0.7:


An error occurred while loading the PDF.
PDF.js v2.4.456 (build: 228a591c)
Message: Failed to fetch

This happens if trying to open shared PDF files in Chrome. All other browsers are also failing.

Been facing the same issue. Unfortunatelly only revert to 20.0.6 seems to help at the moment.

I have the same issues as you describe. Only with shared links as you de describe. Nextcloud 20.0.7. on Debian Buster.

Here is the bug report: Cannot open PDF inside shared folders · Issue #305 · nextcloud/files_pdfviewer · GitHub
This is the offending App: GitHub - nextcloud/files_pdfviewer: A PDF viewer for Nextcloud
I disabled the PDF viewer app and the files can now be downloaded by the recipient accessing the shared folder link.

1 Like

Similar problem using 20.0.7. Public share link to a Folder holding PDF documents lists the PDF document as “corrupted” when one attempts to view the PDF file. Disabling the NextCloud PDF viewer app somewhat resolves the problem. PDF document is immediately downloaded then opened; rather than showing option to download button.

This bug is fixed and will be released in 20.0.8 and 21.0.0

I confirm, it works in NC21

Yes in Nextcloud 20.0.8 and 21.0.0 the PDF Viewer works from external storage und from

Nextcloud Storage

but in Nextcloud 20.0.9 and Nextcloud 21.0.1 i get this error from external storage loaded pdf

PDF.js v2.4.456 (build: 228a591c)

network error

I imported my backup to Nextcloud 20.0.8 and the PDF Viewer worked fine

please fix this :slight_smile:

1 Like

The fix earlier in the thread still works. So it seems to be a re-introduced error fpr 20.0.9.

Did you see this comment ? Fix opening pdf files in public folder shares by juliushaertl · Pull Request #319 · nextcloud/files_pdfviewer · GitHub

Nextcloud 21.0.1: The BUG is still not fixed

Just upgraded some Nextcloud installations to versions 20.0.10 and 21.0.2.
The error in picture occurs on files in group folder, external storage (smb, in my case), shared folders and local folders whose path contains spaces.

Yes, you’re correct. As I’ve discovered in NC21.0.2, if the path/file name contains spaces in shared (local) folder it will result in this error.

No, it is a new bug with NC21.0.2. Here is a hotfix: Can't open PDF when filename or folder name contains a space or special character (' ', é, ...) · Issue #381 · nextcloud/files_pdfviewer · GitHub

1 Like

Got it - thanks. Yes, that fixes it :grinning: