File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display the content of PDF file in a JSF Component

 
Ragav Baskaran
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello EveryOne,

I'm new to JSF and My requirement is to display the content of a PDF file in a UIComponent in such a way that, the content shouldn't be selectable by mouse and there shouldn't be any option to save/copy the PDF content.

Is this possible with any existing JSF component ?

Thanks.
 
Ragav Baskaran
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean do we have any UI component on which we can get an OutputStream to write the byte content ?

Thanks.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way to display PDFs on a web page is via a PDF plugin, and then it'll show only the PDF, not the web page.

It's not really possible to convert PDF to HTML.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17622
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. There's no PDF in-page plugin for any popular browser I know of and therefore no JSF tag to support one; probably in part because of the Eolas patent that resulted in a half-billion-dollar judgement against Microsoft. In part, probably because a PDF and its associated navigation controls take up so much screen real estate that it's simpler just to give the whole window to the reader.

You'll do better to avoid JSF for the part of webapp that displays PDF's and just output them through a regular servlet.
 
Ragav Baskaran
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response.

Also i heard that by writing a custom UI Component could "or may" help to display such file contents ?

Not sure if this is possible as i'm new to JSF..

Does it sounds feasible?

Thanks,
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it sounds feasible?

No.
 
Jerwin Louise Uy
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always delegate the responsibility of rendering byte content in a servlet, however the component can't control the default toolbars when the adobe plugin kicks in.

Simply create a custom component that extends UIOuput and have all the properties of a iframe html where the url of the servlet can be set.



Essentially, we can bind this component on a managed bean and simply pass the attributes to the servlet through the request/session.

I hope this code snippet will be useful though it is just a rough draft of the code.

Regards.
[ August 08, 2008: Message edited by: Jerwin Louise Uy ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic