I want to remove toolbar coming with PDF while rendering through iframe
. It is working fine in browsers such as Chrome, IE when I use #toolbar=0
with the URL (or file path). But it is not working in Firefox.
Can anyone suggest where am I doing wrong ?
This is my code.
<html>
<body>
<iframe src="Reports/reports.pdf#toolbar=0" width="100%;" height="80%">
</iframe>
</html>
I think it's also dependent on the application/plugin in which browser opens PDF, it works differently and it might ignore there directives (depending on browser, plugin, platform, PDF viewer).
The general recommendation here is to use these "directives" at the end of URL:
#toolbar=0&navpanes=0
You may also try recommendations from http://blogs.adobe.com/pdfdevjunkie/web_designers_guide :
You could use basic HTML markup to embed PDF files in your page but there is a more elegant solution out there. Take a look at PDFObject by Philip Hutchison. PDFObject is a pretty easy scripting tool for dynamically embedding PDF files into web pages. It uses JavaScript to inject an element into the DOM tree of your HTML file. There’s even a handy code generator to help you out with all of the extra parameters you 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 to PDFObject
is here: http://www.pdfobject.com/ (taken from their website)
SMALL UPDATE
Disclaimer: To avoid further speculations on the topic, you need to take into consideration that your clients/customers might have different plugins and PDF viewers installed on their machines, and different versioning of applications and plugins, so none of the above solutions will work in 100% of the cases. Adobe for example, has separate plugin for Firefox installed, and they had different versions and different behavior built in.
here's reference for the tricky case with FF and Reader X, as the good example of the above said.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With