-1

For example, I have a pdf file link like this:
https://boliden.chemsoft.eu/BlackBoxInterface.aspx?output=doc&id=20647&filesekv=85858&filename=Zinc_2015-06-01_English.pdf.
If I create a link
<a href="https://boliden.chemsoft.eu/BlackBoxInterface.aspx?output=doc&id=20647&filesekv=85858&filename=Zinc_2015-06-01_English.pdf">Pure zink, Zinc_2015-06-01_English.pdf</a>
When I click this link, instead of showing the pdf file, the browser download it automatically.

So is there any way to open that PDF file using js?

ManmeetP
  • 801
  • 7
  • 17
An Vo
  • 1

1 Answers1

0

You could force the display of the PDF by using a library like PDF.js.

Otherwise, the user's browser will decide to either download or display the PDF document (assuming you do not send a force-download header).

-- EDIT

Following Barmar's comment, you indeed need to remove the Content-disposition: attachment header to let the browser decide.

nicovank
  • 3,157
  • 1
  • 21
  • 42