How to hide the X (close) option on a PDF opened in SharePoint.

Shelley Rosencrantz 25 Reputation points
2023-06-16T15:24:27.0733333+00:00

I am offering new hires a site introducing them to our company. On this site are documents in PDF form for them to click on the Quick Link to open and view. When they open the pdf, there is the typical X in the top right to close the document, which is great, although it takes them to the document library. I want them to use the back button to go back to the home page and continue reviewing the site. I do NOT want them to end up in the document library. Is there an option to hide the X (close)?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,216 questions
{count} vote

Accepted answer
  1. Ling Zhou_MSFT 21,495 Reputation points Microsoft Vendor
    2023-06-20T01:29:08.9066667+00:00

    Hi @Shelley Rosencrantz,

    Thank you for your reply.

    Per my knowledge, there is no way for SharePoint to modify this page at this time. It is designed by SharePoint. All documents opened in preview use the same page template, and if modified, it is likely that all documents will be affected.

    Thank you for your understanding and tolerance!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Paula Crow 5 Reputation points
    2024-04-06T02:22:11.0033333+00:00

    Looking to do this too, but thinking it's likely not possible as it's just part of the pdf viewer. Would love to hear that's not the case or a workaround though. You could make sure all your pdf links are using the direct link to the file, this way they will open in the app instead of the browser. This isn't as user friendly as it's taking them out of the browser, but could work for your purposes. I am thinking on our end we will just be educating staff to close the file by closing the tab rather than using the x. When docs open in the browser Word or Excel there isn't this issue as there is no x.

    1 person found this answer helpful.
    0 comments No comments

  2. Chen, Albert I :LSO Staffing Office 5 Reputation points
    2024-05-29T23:06:36.06+00:00
    1 person found this answer helpful.

  3. Ivica Fetkovicova 5 Reputation points
    2024-10-03T10:08:19.84+00:00

    I had the same problem. And I reproduced the case by sharing links in 2 different ways.:

    • when you click on share button next to document name, it opens the file with X button and after closing X button, you are redirected to Documents library (which we don´t want)
    • BUT when you go to DETAILS of the document, scroll down on the right side bar (of the details), and you copy only the PATH of the document, it works well (it doesn´t allow you to click X, but shows only arrow to return to previous page.

    SHORT: always copy PATH of the document, not link for sharing.

    Here is correct way to copy the path to your source document in library. Correct

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.