This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes open a file pdf in unix using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "open a file pdf in unix using java" Watch "open a file pdf in unix using java" New topic
Author

open a file pdf in unix using java

Monica Marugan
Greenhorn

Joined: Feb 26, 2008
Posts: 6
I have a file pdf in a path in SO UNIX and I need open this file with java code.
In windows I have used :

Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + fichpdf);

In unix I don't know do.
Thank you
Anil Karamchandan
Ranch Hand

Joined: Sep 12, 2009
Posts: 47
has anyone got a reply to this ? I have the same problem
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
I think the Acrobat Reader can be started from the command line in Unix.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20078
    
  30

If there is a proper file association then Desktop.open should work. Otherwise you would need to explicitly give the command, including the path to the PDF program (Acrobat Reader, XPDF, ???).


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
Have you checked out Aspose?
 
subject: open a file pdf in unix using java
 
It's not a secret anymore!