Mahmoud Saleh
Mahmoud Saleh

Reputation: 33605

Display inline pdf file in same page and print it

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

Answers (2)

Răzvan Flavius Panda
Răzvan Flavius Panda

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:

http://goo.gl/t3jaI

Upvotes: -1

Daniel
Daniel

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

Related Questions