Restrict PDF Download – View Only in DSpace 9.1

45 views
Skip to first unread message

Chand Malik

unread,
Aug 28, 2025, 5:52:35 AMAug 28
to DSpace Community

Dear Team,

We have installed DSpace 9.1. My concern is that I want to restrict users from downloading PDFs and allow them only to view the PDFs in DSpace. Could you please guide me on how to stop the download and enable view-only access


DSpace Community

unread,
Aug 28, 2025, 5:17:57 PMAug 28
to DSpace Community
Hi,

DSpace does not have a built in PDF viewer that can support this feature. In DSpace you can either download the PDF or you cannot, and there's no way to allow viewing but disallow downloading.

In other words, this would require a custom solution / custom code.  It's always possible someone on this mailing list has found a custom way to achieve this and can share their solution.

Tim

Chand Malik

unread,
Aug 28, 2025, 11:15:00 PMAug 28
to DSpace Community
Hai 
"Can you please guide me on which file is related to the PDF viewer code, where we can add the changes? Should it be done in the frontend file or the backend file? please mention the file name.

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-communi...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dspace-community/cda0050c-8f5d-4a89-81eb-1e8b8455cdb9n%40googlegroups.com.

Hoang Loc Guitar - Tự học đàn cổ nhạc Việt Nam

unread,
Aug 29, 2025, 7:16:01 AMAug 29
to Chand Malik, DSpace Community
Dear Chand Malik,

Suggestions for Integrating ngx-extended-pdf-viewer into DSpace 9.1


Prerequisites

  • Advanced knowledge of the Angular 18 framework is required.

  • The ngx-extended-pdf-viewer integration will be done in the frontend and will only work in production mode.

Implementation Steps

First, you'll need a code editor, such as Visual Studio Code. Then, open your dspace-angular-dspace-9.1 project.

Step 1:

  • Run your dspace-angular-dspace-9.1 project using the command: npm run start:dev

  • Install the ngx-extended-pdf-viewer library with the following npm command: npm i ngx-extended-pdf-viewer --legacy-peer-deps

  • Edit the source code of the file-download-link component, located in dspace-angular-dspace-9.1/src/app/shared/file-download-link. You will need to modify the files file-download-link.component.ts and file-download-link.component.html.

Step 2:

  • Create a new component named pdf-viewer-modal in the dspace-angular-dspace-9.1/src/app/shared directory.

  • Write the source code for the new component, including the files pdf-viewer-modal.component.ts, pdf-viewer-modal.component.html, and pdf-viewer-modal.component.scss.

Step 3:

  • Recompile your project using the command: npm run build:prod

Good luck!

Reply all
Reply to author
Forward
0 new messages