Reputation: 33605
i have a formatted pdf file, and i want to display it (with the same format) in the jsf page and be able to print it.
please advise how to accomplish that.
Upvotes: 0
Views: 1548
Reputation: 22106
You can use an iframe to show the pdf:
<iframe src="test.pdf" width="900" height="500"></iframe>
It can be printed by right clicking and choosing print.
You are probably going to need plugins which are able to display the pdf on some browsers, like adobe reader or foxit.
For Foxit Reader to set the plugin the user needs to check Display PDF in Browser
:
Upvotes: -1
Reputation: 37051
Take a look at the p:media tag in showcase
<p:media value="/resources/other/guide.pdf" width="100%" height="300px">
Your browser can't display pdf,
<h:outputLink value="/resources/other/guide.pdf">click</h:outputLink> to download pdf instead.
</p:media>
The content of p:media
(Your browser ...) will be displayed in case that the browser can't display the pdf for some reason
Upvotes: 4