Reputation: 33
Two questions:
1º This piece of code works fine in Chrome and Firefox, but not on IE, where I only can see a grey box displayed in the dialog panel (IE 11 windows 7)
<p:dialog ...>
<p:media value="/tmp/doc.pdf" width="800px" height="400px" player="pdf">
</p:media>
</p:dialog>
2º Also, I'd like users only to view the file, not to download, print, ... So I'd like to hide the toolbar of the pdf viewer. I've tried playing with parameters pdf parameters but the example below doesn't work
<p:media value="/tmp/doc.pdf#toolbar=0 ..."
If I use <Object>
instead <p:media>
I don't get the toolbar working (and I don't know why), but it still doesn't work on IE.
Curiously, if I go to primefaces media demo page with IE, I can see the pdf viewer demo without problems, and I suppose that this page is written with primefaces.
Thanks in advance
Upvotes: 1
Views: 4254
Reputation: 33
If I use <p:overlayPanel>
instead of <p:dialog>
now it works fine on IE (and Chrome, Firefox ...).
Also, the "#toolbar=0" parameter works fine... but only in IE.
I realize that the viewer of IE is the acrobat reader (acroPDF.dll) and it works fine when I use
<p:overlayPanel ...>
<object data='tmp/doc.pdf#toolbar=0' type='application/pdf' height=...'/>
</p:overlayPanel>
Chrome and Firefox use another viewers. Does anyone know how I can indicate this viewers not to show the toolbar?
Thanks again
Upvotes: 1