• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Is this possible?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
Just wondering if anyone could tell me simply if its possible to initiated a .pdf file using java.
Basically, i want a user to be able to double click on a file and the pdf to open in such a way that they can only view it and have no idea what the file is (as all the file details will be hidden in the java class)
I know about jar files, and was hoping that i could write a reasonably short java program that could be double clicked and open up a pdf file.
Alternatively, is there a way java can be used to 'install' files into a computer from a cdrom?
Thanks for youre help.
Hannah
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well you can issue an operating system command to execute adobe Acrobat with the pdf that you want to display as an input parameter.
Runtime.getRuntime().exec("acroRD32.exe myFile.pdf");
 
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look up javax.activation package.

If you pass in a text file e.g. "foo.txt", it will
return three command names:
content-handler
view
edit
You can then send a command to the DataHandler
and it will be activated accordingly i.e. a viewer
opens.
Pho
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When your have a < sign, always use &lt; instead.

SCJD Study Group has been moved to http://www.developergroup.org/
[This message has been edited by Roseanne Zhang (edited October 12, 2001).]
 
Pho Tek
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Roseanne, I'll remember to do that in the future.
Pho
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic