When I use <iframe src="some_pdf_file.pdf/>
on a PDF that has the header Content-Disposition
set to attachment
the iframe
decides to download the file instead of rendering it. This is reasonable behavior, however I want to force the PDF to be rendered in the iframe
.
How can I do this? Is it possible to download the file and then change the Content-Disposition
header to inline
?
<object
data='https://pdfjs-express.s3-us-west-2.amazonaws.com/docs/choosing-a-pdf-viewer.pdf'
type="application/pdf"
width="500"
height="678"
>
<iframe
src='https://pdfjs-express.s3-us-west-2.amazonaws.com/docs/choosing-a-pdf-viewer.pdf'
width="500"
height="678"
>
<p>This browser does not support PDF!</p>
</iframe>
</object>