Sunday, February 05, 2006

Using Native Application to open file

This may be of interest to you. I have been looking around the web and found on a post that it is possible to open the real Acrobat viewer from Java, although it is O/S specific.
  • For windows :
  • Runtime.getRuntime().exec(new String[]{ "rundll32", "url.dll,FileProtocolHandler", "filename.pdf" });
  • For a mac:
  • Runtime.getRuntime().exec(new String[]{"open", "filename.pdf" });

No comments: