Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable/Hide download button in iframe on default PDF Viewer

i am using #toolbar=0&navpanes=0&scrollbar=0 in iframe url for disabling toolbar but in Mozzila it doesn't work. I tryed to import javascript into iframe, but the same result.... iframe:

<iframe ?wmode="transparent" type="application/pdf" id="iframe" src="'.$url.'#toolbar=0&navpanes=0&scrollbar=0" width="100%" height="685"></iframe>

used js:

jQuery('#iframe').load(function(){
    jQuery('#iframe').contents().find("#toolbarViewerRight").hide();
});

Any idea, how can i disable/remove/hide this toolbar or only download button?

like image 597
Juraj Avatar asked Jan 11 '17 08:01

Juraj


People also ask

How do I disable the download button on my PDF bar?

You cannot disable it, as it's not part of the iframe . You can't control that, since it's a browser feature.

How do I remove the download button from PDF viewer?

A: There is no way to disable the download button on the PDF viewer that displays the document.

Why does PDF document download instead of showing in a embed iframe?

The server sends the data with a HTTP header inline-disposition that causes a download.


1 Answers

Use #toolbar=0 after your .pdf file name in src

<iframe src="your-pdf-name.pdf#toolbar=0"></iframe>
like image 151
Vijay Lathiya Avatar answered Sep 27 '22 20:09

Vijay Lathiya