• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Display the content of PDF file in a JSF Component

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Does it sounds feasible?


No.
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic