Search code examples
htmlpdfiframe

PDF tollbar without download button


Is there a way to have an iFrame with full toolbar except for the download button.

On the web I found this solution

<iframe src="URL#toolbar=0" width="100%" height="100%"></iframe>

But as u know it removes completely the toolbar and I would love to actually keep it.

Basically: this is how is normally and this is I would love to have it (or something similar). I already know i cannot prevent ppl to download it in other way, but I'm only interest in this graphic difference

Thanks to anyone who could help me


Also I noticed that mozilla doesnt view iFrame, is there a way to allowed it or something similar? I need something that ppl can use without changing configuration on their personal mozilla


The look that I'm looking for (asked by my boss) -> toolbar


Solution

  • Mozilla browsers have no problem with Iframe, but browsers are configured by users to their security preferences.

    <iframe id="page2" height="50%" width="100%"src="http://africau.edu/images/default/sample.pdf#page=2"></iframe>
    <iframe id="page1" height="50%" width="100%"src="http://africau.edu/images/default/sample.pdf#page=1"></iframe>
    

    Same as the web page text and images, Audio or Video content, all pdfs are "Download first to view" does not matter if

    • A=Href
    • Embed
    • Iframe
    • Object (avoid as depreciated)
    • cUrl (Users direct get)

    So why remove the button if its not showing in the frame due to any ad blocker or other user setting such as send downloads into external secured PDF viewer

    Mozilla browser with pdf plugin or add-in or PDF extender same as Chrome/Edge

    enter image description here

    FireFox with a frame blocker active for the same page 3 blocked items.

    enter image description here

    If you wish to change the Iframe view you need to be the PDF viewer application, but there is no guarantee it is the one the user is viewing within.

    enter image description here

    Here is a demo of a browser viewer where the download and print buttons are removed. However Browsers need to allow the user to control their own view so I have also opened the download on the right in a companion viewer. A PDF client cannot view a PDF unless it is Decrypted after a download thus their copy is available for view and edit.

    enter image description here