How to Change SharePoint PDF Close-Button Behavior
Question details
The user needs to change the default behavior of the PDF close button in SharePoint so that it redirects to a specific SharePoint page instead of returning to the document library.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Opening and closing PDF documents hosted in a SharePoint document library.
- Observed behavior
- When a PDF is closed, SharePoint automatically returns the user to the document library instead of navigating to a designated SharePoint page.
Note that modifying native SharePoint navigation behaviors requires administrative permissions and familiarity with custom script development or the SharePoint Framework (SPFx).
Request Custom Development Guidance via Microsoft Q&A
Because standard SharePoint settings do not support changing the PDF close-button destination, custom development is required to implement this specific redirect behavior.
Currently, SharePoint's built-in PDF viewer is hardcoded to return users to the originating document library upon closing.
To override this limitation and redirect users to a specific SharePoint page, you will need to implement a custom coding solution using the SharePoint Framework (SPFx) or custom web parts.
Open your web browser and go to the official Microsoft Q&A community platform.
Log in using your Microsoft credentials associated with your SharePoint administration or developer account.
Click on 'Ask a question' and describe your specific requirement for redirecting users to a custom page after closing a PDF.
Ensure you add the 'SharePoint Development' tag to your post so that it reaches the right developers and Microsoft engineers who can provide accurate custom code guidance.

Handle PDFs and Documents Seamlessly with WPS Office
While SharePoint requires custom coding for specific PDF navigation behaviors online, managing your documents locally shouldn't be complicated. WPS Office is a free, lightweight alternative to Microsoft Office that includes a powerful built-in PDF editor, ensuring you can read, annotate, and manage PDFs effortlessly without worrying about complex browser settings.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
- 2. Install and Set Up: Run the downloaded installer and follow the simple on-screen instructions to complete the setup in minutes.
- 3. Manage Your Documents: Launch WPS Office to easily open, edit, and organize your PDFs, Word documents, Excel spreadsheets, and PowerPoint presentations.

Frequently Asked Questions
Can I change the PDF close button behavior using default SharePoint settings?
No, standard SharePoint document library settings do not offer an out-of-the-box option to change the destination URL when closing the built-in PDF viewer. This requirement necessitates a custom development approach.
What is the default behavior when closing a PDF in a SharePoint library?
By default, when you open a PDF link from a SharePoint document library and then close the viewer tab or window, the system automatically redirects you back to the originating document library.
Where can I get help for SharePoint custom development?
The best place to request custom development guidance is the Microsoft Q&A forum. Be sure to use the 'SharePoint Development' tag to reach experts who can assist with SharePoint Framework (SPFx) solutions and customizations.




