Skip to content Skip to sidebar Skip to footer

How Do I Display A PDF Onto A JSF Page

I want to display a PDF file onto my JSF page, I have check this how to display a pdf document in jsf page in iFrame, but I dont want to display it on an iframe(since it will gener

Solution 1:

There's not really another way (expect from HTML <object> tag which would have the same "problems"), but you can just give the <iframe> a fixed size and disable the scrolling as follows:

<iframe src="foo.pdf" width="600" height="400" scrolling="no"></iframe>

If you also want to hide the (default) border, add frameBorder="0" as well.


Solution 2:

You should take a look at ICEpdf, it creates an image on the server side, gives zooming, and other controls (demo).


Solution 3:

Try going into Adobe Reader, and under the Options dialog there are web settings where you can indicate that you always want PDF type documents to open within the browser.

This is unfortunately a client side fix and doesn't take into account other PDF readers.


Solution 4:

What you want is impossible. Browsers are not magic, they just display different kinds of documents, some of which (HTML) can embed objects provided by plugins (flash, java) and other documents inside iframes (pdf, flash, html). If you want to show pdf miniatures, you will have to generate images on the server.


Post a Comment for "How Do I Display A PDF Onto A JSF Page"