How to Force SharePoint PDF Files to Download Instead of Opening in Browser
Question details
Users need to force PDF files in SharePoint to download automatically instead of opening in the web browser, which risks users overwriting original fillable forms.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Managing and distributing fillable PDF forms within a SharePoint document library.
- Observed behavior
- SharePoint opens PDF files in the browser by default, bypassing the library's 'open in desktop application' setting, allowing users to inadvertently edit and save over the original master file.
Since this workaround alters how all files in the modified column behave, consider creating a dedicated SharePoint document library exclusively for your PDF files to prevent affecting Word or Excel documents.
Apply JSON Formatting to the Name Column
Modify the column formatting with a JSON script to change the default click action to point directly to the download endpoint.
The built-in SharePoint setting for opening files in client applications only applies to native Office formats, not PDFs. By using a custom JSON script on the 'Name' column, you can force the hyperlink to trigger a direct file download rather than launching the in-browser PDF preview.
Open your SharePoint site and navigate to the Document Library where your fillable PDF files are stored.
Click the down arrow next to the 'Name' column header, select 'Column settings' from the dropdown menu, and then click 'Format this column'.
At the bottom of the column formatting pane on the right side of the screen, click the 'Advanced mode' link to enable JSON input.
Paste the following JSON code into the text box: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "a", "txtContent": "@currentField", "attributes": { "target": "_blank", "href": "= @currentWeb + '/_layouts/download.aspx?SourceUrl='+[$FileRef]" } }
Click 'Save' to apply the formatting. Test the implementation by clicking a PDF file name; it should now immediately prompt a file download.

Edit Downloaded PDFs Seamlessly with WPS Office
Once you successfully force SharePoint to download your PDF files, you need a reliable desktop application to fill, edit, and manage them. WPS Office provides a comprehensive, lightweight suite with a powerful built-in PDF editor that works perfectly alongside your regular Office formats.
- 1. Install WPS Office: Download and install WPS Office on your computer to handle your downloaded SharePoint documents.
- 2. Locate the PDF: Find the PDF file you just downloaded from your SharePoint document library in your local Downloads folder.
- 3. Open and Fill: Right-click the file, select 'Open with', and choose WPS Office to securely view and fill out your PDF form without altering the original SharePoint file.

Frequently Asked Questions
Why does SharePoint ignore the 'Open in desktop client' setting for PDFs?
SharePoint's default setting for opening files in a desktop client is designed specifically for Microsoft Office files like Word, Excel, and PowerPoint. PDF files natively default to a browser preview mode, bypassing this Microsoft-specific setting.
Will applying the JSON formatting affect other document types in the library?
Yes, column formatting applies to all files within that view or library. If you have Word or Excel files in the same library, clicking their names will also force a download instead of opening them in Office Online. It is highly recommended to store PDFs in a separate, dedicated library if you use this workaround.
Can I use this exact JSON formatting on SharePoint Server 2019?
The JSON workaround provided is designed and fully tested for SharePoint Online. SharePoint 2019 on-premises environments handle URL generation and download endpoints differently, so the same JSON code may fail to download the file and could require custom configuration suited for on-premises servers.




