aspose file tools*
The moose likes Beginning Java and the fly likes Opening a pdf file from UNIX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Opening a pdf file from UNIX" Watch "Opening a pdf file from UNIX" New topic
Author

Opening a pdf file from UNIX

Ragav Seth
Greenhorn

Joined: Jan 17, 2005
Posts: 16
Hello All,

I have the following problem. I have my j2ee application installed in an Unix box.

I maintain a folder in the unix system which has got some PDF files.

Now in my application,I have a hyperlink which opens any one of these PDF files in a new window in a browser.

Iam not able to view the PDF in the browser.I used a plain ahref on the filepath in unix and its not working.

Does the unix system on which the J2EE app is hosted has to have a "Acrobat Reader" installed so that I can use Runtime.getRuntime().exec("") method to view the PDF file?

Thanks
Ragav
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
The client system (i.e., yours) needs to have a PDF viewer (most often Acrobat Reader) installed. The server doesn't need one (it simply streams the file to the client).


Ping & DNS - updated with new look and Ping home screen widget
Ragav Seth
Greenhorn

Joined: Jan 17, 2005
Posts: 16
Thanks for the reply.

Iam getting the following error though when I try to open the PDF.Other applications are opening perfectly though like word,excel etc.

The error message is

"Adobe reader could not open the file because it is either not a supported file type
or because the file has been corrupted(for example, it
was sent as an email attachment and wasn't correctly decoded)".

The file is not corrupt as Iam able to open it.But when I upload the pdf file to the server and try to read it in my application(a jsp page with a href link to the document from the server),its giving me this error.

Thanks
Ragav
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
Maybe the file gets corrupted during the upload and download process? Have you verified that what gets downloaded is exactly the same as what you uploaded?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Opening a pdf file from UNIX
 
Similar Threads
What must I add to the server.policy file to execute the shell program /usr/bin/chmod ?
Problems uploading with Apache FileUpload
Publishing directory in Websphere App Server
Is standalone websphere application server exists???
Upload a file to unix and invoke a java method