Skip to content

PDFs shared via public read-only links don’t display when secure view + watermark is enabled #5143

@Jerome-Herbinet

Description

@Jerome-Herbinet

Bug description
PDF files shared via public read-only links are not displayed. The standard PDF reader (not Nextcloud Office in read-only view) displays a blank page (and a page count of 0/0) when secure display + watermark is enabled.

To reproduce the bug
Steps to reproduce the behavior:

  1. Create a public read-only share for a PDF file and apply a “confidential” tag to the file.
  2. In the Nextcloud Office admin settings, enable secure display with watermark (enter what you what in the watermark text field ; in my case for sample screenshots : "test"). This display must be triggered by the “confidential” tag (you can also check the option to enable secure display for external read-only shares).
  3. Test the public share URL you created and note that the PDF does not display correctly (blank page and number of pages 0/0, in the standard PDF reader).
  4. Then go to the sharing settings and check the “Hide download” option... and it finally works, in Nextcloud Office with read-only view and watermark

There is a solution in point 4... except that it's not practical and it's a safe bet that many people share files of this nature:

  • without knowing that they don't work properly
  • without understanding or knowing that they need to hide the download (and those who do understand will inevitably make the mistake at some point)

Then, I don't have a real solution in mind... because there are several things to consider in terms of technology and usability. In any case, things need to be made clearer to prevent people from falling into this trap, or if it's a “simple” goal, it needs to be corrected.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
When the “Hide download” option is not checked, the document opens incorrectly in the standard PDF viewer :
Image

When the “Hide download” option is checked, the document opens correctly in Nextcloud Office with read-only view :
Image

Client details:

  • Browser Firefox and Ungoogled Chromium
  • Device: Ubuntu 22.04 (Gnome)

Server details

Operating system:
Linux

Web server:
nginx

Database:
mariadb

PHP version:
8.2/ 8.3

Nextcloud version:

COOLWSD version: 25.04.5.5(git hash: dfe56def27)
LOKit version: Collabora Office 25.04.5.3(git hash: 0004188293)
Served by: Rocky Linux 9.5 (Blue Onyx)
Server ID: 7c635b80
WOPI host: nextcloud 31.0.10.2 - richdocuments 8.7.6

COOLWSD version: 25.04.5.4(git hash: be0b3cc3ef (E))
LOKit version: Collabora Office 25.04.5.3(git hash: 0004188293)
Served by: Ubuntu 22.04.5 LTS
Server ID: 324d64df
WOPI host: nextcloud 31.0.8.1 - richdocuments 8.7.6

Can be provided if necessary
Logs

Nextcloud log (data/nextcloud.log)

Can be provided if necessary

Browser log

Can be provided if necessary

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions