Consider the following scenario.
- You browse to a SharePoint Online or OneDrive for Business site, and then you click SHARE for a PDF file.
- You click Get a link, and then click CREATE LINK for either the View Only or Edit options.
- You share the link with a user.
In this scenario, when the user browses to the shared PDF, they're prompted to download the file and they can't view it in the browser.
This is expected behavior in SharePoint Online. Users must download the PDF file in order to view it.