javascript - Hide toolbar of pdf file opened inside iframe using firefox -


other browsers such chrome,ie working fine when given #toolbar=0.but not working in firefox. please help.

this code.

<html> <body> <iframe src="reports/reports.pdf#toolbar=0" width="100%;" height="80%">                         </iframe> </html> 

i think it's dependent on application/plugin in browser opens pdf, works differently , might ignore there directives (depending on browser, plugin, platform, pdf viewer).

the general recommendation here use these "directives" @ end of url:

#toolbar=0&navpanes=0 

you may try recommendations http://blogs.adobe.com/pdfdevjunkie/web_designers_guide :

embedding using pdfobject

you use basic html markup embed pdf files in page there more elegant solution out there. take @ pdfobject philip hutchison. pdfobject pretty easy scripting tool dynamically embedding pdf files web pages. uses javascript inject element dom tree of html file. there’s handy code generator out of parameters may need.

<script type="text/javascript" src="scripts/pdfobject.js"></script> <div id="pdf1" style="width:500px; height:375px;"></div> <script type='text/javascript'> var mypdf = new pdfobject({       url: 'conferenceguide.pdf',       pdfopenparams: {            view: 'fit',            scrollbars: '0',            toolbar: '0',            statusbar: '0',            navpanes: '0' }       }).embed('pdf1');  </script> 

the link pdfobject here: http://www.pdfobject.com/ (taken website)


small update

disclaimer: avoid further speculations on topic, need take consideration clients/customers might have different plugins , pdf viewers installed on machines, , different versioning of applications , plugins, none of above solutions work in 100% of cases. adobe example, has separate plugin firefox installed, , had different versions , different behavior built in.

here's reference tricky case ff , reader x, example of above said.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -