Change Default PDF Viewer To Custom Application

Correy Lim 1 Reputation point
2021-08-18T22:26:05.623+00:00

Hello Microsoft Community,

(Please note I originally asked my question below here: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_sharepoint-mso_win10-msoversion_other/change-default-pdf-viewer-to-custom-application/5fb8cbf8-1d7e-426d-80eb-891ee90692dc but was instructed to post my question in this forum instead)

I have been successful in integrating PDFTron's JavaScript WebViewer library as part of my Sharepoint Online deployment by following the instructions provided here:

https://www.pdftron.com/documentation/web/get-started/sharepoint/

However, one of the questions that has come up is if we could overwrite Sharepoint Online's default behavior when clicking on the name of a PDF document.

To be clear, here is the current default behavior in Sharepoint Online:

124349-image.png

Clicking on PDFTRON_about.pdf opens Sharepoint Online's default PDF viewer:

124350-image.png

The requirement is to instead to be redirected to the Sharepoint Page I created and where the WebViewer JavaScript library is instantiated:

124358-image.png

Alternatively, we could also accept an Externally Hosted Web App being opened. The other integration that we have achieved is by adding a contextual menu option for PDFs like so:

124491-image.png

Which then opens a separate tab (currently a local development instance of our Web App), and using a combination of Query Parameters & Sharepoint Online APIs to retrieve/save documents:

124492-image.png

Any advice on how to overwrite the default Open behavior would be greatly appreciated.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,794 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. CaseyYang-MSFT 10,436 Reputation points
    2021-08-19T03:20:59.427+00:00

    Hi @Correy Lim ,

    Yes, PDF files always be opened in SharePoint online default view. This behavior is by default. We suggest you develop your own file handler. Otherwise, it will be handled by SharePoint or if you integrate something like Adobe Document Cloud, opened by Doc Cloud (which is still in the browser, but Adobe's service instead). In this case: How to open a PDF file in directly in PDF Viewer instead of in SharePoint? ATG-5876 provided a workaround for you reference: Checkout and Open PDF files from SharePoint Document Libraries.

    For Reference:
    https://www.bonzai-intranet.com/blog/checkout-and-open-pdf-files-from-sharepoint-document-libraries/
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    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


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.