pipwerks / PDFObject

A lightweight JavaScript utility for dynamically embedding PDFs in HTML documents.
http://pdfobject.com/
Other
2.39k stars 986 forks source link

Prevent download pdf automatically #294

Closed billoneillighttiger closed 1 year ago

billoneillighttiger commented 1 year ago

I have tried to embed this pdf into an HTML file and run the code, but can't see the embedded pdf, but automatically downloaded, how to prevent this? https://storage.procore.com/v4/d/us-east-1/pro-core.com/56ce94e3-bab3-4b0d-ad4b-da9b8c6e7214_production_merged.pdf?sig=a0c7612dd0d6a588c0b1fcac152aee6818fa926642b83fb87325c956fabe9b1e

pipwerks commented 1 year ago

The server needs to serve the file with the Content-Disposition header set to inline. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

If the server is already configured properly, double-check that your browser is configured to display PDFs inline and doesn't auto-download them. This is user-configurable and varies from browser to browser. (By default, all major desktop browsers display PDFs inline.)