On a click event, I want to render a PDF inside an element, and I'm appending it in an object
tag.
As a fallback for older browsers, I'd like to make the PDF to download automatically. Here's what I'm working with
<div class="selected">
<object data="loader-resources/doc.pdf" type="application/pdf" class="loaded" width="100%" height="100%">
<p class="error">Your browser cannot display pdf within a website.</p>
</object>
</div>
I can't do this server-side, via Content Disposition in my HttpResponse header as it directs here, because I want the PDF to render on-page if the user's browser supports it.
Any ideas?