nextcloud / nextcloud/files_pdfviewer

PDF Viewer in Nextcloud 25 not working with QtWebEngine 5.15 LTS (Chromium 87 based) - please use PDF.js legacy build

Open
#684 17 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug dependencies
Dominant language
JavaScript
Stars
108
Forks
61
Avg merge
2d 9h
Merged PRs (30d)
29

Description

Steps to reproduce
  1. Open up-to-date versions of Falkon and Qt 5 QtWebEngine.
  2. Log into Nextcloud. That works fine.
  3. Try to view a PDF. That does not. It worked in Nextcloud 24.
Expected behaviour

The PDF is displayed.

Actual behaviour

Blank space is displayed instead of the PDF viewer, and I get errors in the JavaScript console.

Additional information

The issue is that the PDF.js version was upgraded from 2.13.216 to 2.15.349, which introduces new JavaScript constructs not supported in Chromium 87, and that you use the default build of PDF.js, which supports only the very latest browsers, instead of the legacy build, which is much more compatible (see https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support). QtWebEngine 5.15 LTS is a stable branch with backported security fixes (comparable to the Firefox ESR branches).

I was able to quickly work around the issue by downgrading PDF.js to 2.13.216 on the server I administer, but I think using the legacy build would be a better long-term fix. I have not tried that yet, because I am not sure what exactly I need to change. (pdfjs-dist ships both the default and the legacy build, the latter in a subdirectory.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating where pdfjs-dist is imported or bundled in the PDF viewer, then compare the available default and legacy build paths described in the issue. Verify the change by opening a PDF in Falkon with QtWebEngine 5.15 and confirm that the viewer renders instead of showing blank space and JavaScript errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.