| Author |
opening a PDF file
|
miguel lisboa
Ranch Hand
Joined: Feb 08, 2004
Posts: 1281
|
|
i dont know why this code doesnt give an error but also doesnt open the pdf file
can anyone please help me?
(the file is in the right path)
|
java amateur
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
|
A must-read about Runtime.exec: here.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
You might consider this method:
which has made that Windows hack obsolete.
|
 |
miguel lisboa
Ranch Hand
Joined: Feb 08, 2004
Posts: 1281
|
|
Paul Clapham wrote:You might consider this method:
which has made that Windows hack obsolete.
thank you, Paul
but now i've another problem: if my path has spaces in it, it wont work:
Errorjava.lang.IllegalArgumentException: The file: C:\Documents and Settings\...\C.pdf doesn't exist.
is there any workaround for this situation?
|
 |
chaitanya karthikk
Ranch Hand
Joined: Sep 15, 2009
Posts: 779
|
|
Hi miguel, I had the same problem while writing a program in C++, there I used
c:\\progra~1\\java\\jre6\\lib\\ext\\jxl.jar
.
I don't know how far it will work in Java.
I wrote that program to copy my Java files to respective directories as a part of installing my application on the clients system.
|
Love all, trust a few, do wrong to none.
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
|
Put the file name inside double quotes to work around the space problem
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
miguel lisboa
Ranch Hand
Joined: Feb 08, 2004
Posts: 1281
|
|
|
thanks
|
 |
 |
|
|
subject: opening a PDF file
|
|
|