I want to open a PDF file in the browser but instead of opening, it is downloading. I do not want to change the default settings of the browser.
If there any PDF viewer package which is easy to use, please refer. I tried like this
first import the pdf
import Pdf from "../../../assets/pdf/abc.pdf";
then tried to open it like this
<a href={Pdf} target="\_blank" className="btn"\>Learn More</a>
But it is downloading the file. But I want to open it.
As a user you have full control, as a server you can only request the user follows your desires, but they do not have to.
A PDF application/pdf mime file is a potential source of exploit so just like a user can change settings to block adverts or images they can also block unsolicited display of a PDF.
The browsing client may choose to download and view or download only or do not download it is the same in Mozilla or Chromium, just different plugins.