logo
search
SharePoint Document Issues

How to Force SharePoint PDF Files to Download Instead of Opening in Browser

Maira MehtabMaira Mehtab Oct 1, 2026 868 views

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.

How to Force SharePoint PDF Files to Download Instead of Opening in a Browser
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.
Before you start

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.

Solution 1Recommended

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.

1
Navigate to the Document Library

Open your SharePoint site and navigate to the Document Library where your fillable PDF files are stored.

2
Access Column Formatting

Click the down arrow next to the 'Name' column header, select 'Column settings' from the dropdown menu, and then click 'Format this column'.

3
Switch to Advanced Mode

At the bottom of the column formatting pane on the right side of the screen, click the 'Advanced mode' link to enable JSON input.

4
Input the JSON Code

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]" } }

5
Save and Test

Click 'Save' to apply the formatting. Test the implementation by clicking a PDF file name; it should now immediately prompt a file download.

Apply JSON Formatting to the Name Column
Version Compatibility: This JSON script is confirmed to work in SharePoint Online. Behavior in SharePoint Server (e.g., SharePoint 2019 on-premises) handles download endpoints differently, meaning this specific code may not function properly without server-side adjustments.
Free Microsoft Office alternative

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. 1. Install WPS Office: Download and install WPS Office on your computer to handle your downloaded SharePoint documents.
  2. 2. Locate the PDF: Find the PDF file you just downloaded from your SharePoint document library in your local Downloads folder.
  3. 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.
Built-in PDF reader and editor to seamlessly fill forms and annotate downloaded files.High compatibility with Microsoft Office file formats (.docx, .xlsx, .pptx) for all your SharePoint documents.Lightweight installation with an intuitive, tabbed user interface.Free to use for basic document and PDF viewing needs.
microsoft office alternative - wps office

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.