Html – Embed PDF on a webpage and prevent download


Is there a way to embed a PDF document on a webpage and at the same time disabling download? If possible I would prefer an html5/css3 solution. If no other way is possible I'd go with something else.

Best Solution

Yes. Yes there is:

<div id="pdf">
    <object width="100%" height="650" type="application/pdf" data="[ImageURLHere]#zoom=85&scrollbar=0&toolbar=0&navpanes=0" id="pdf_content" style="pointer-events: none;">
        <p>Insert your error message here, if the PDF cannot be displayed.</p>

The pointer-events: none styling will also prevent users from right-clicking the PDF and downloading.