• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to open a PDF file in linux using java

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to open a PDF file in linux using java. i am able to do in mac and windows but didi not find any common solution for all the linux OS.

Thanks
Appi
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"appi", please check your e-mail for an important administrative message from JavaRanch.
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did any one find a solution to this, even I am facing with the same problem.. I have tried the rundell32 which is used by windows but I am not able to get the answer for Linux OS
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I think this post was old enough to qualify for our "don't wake the zombies" rule, but now that it's up and lurching about, here goes.

I have no clue what rundll32 was supposed to do with opening PDF files.

There are number of utilities that can "open" (as in display) and read (as in processing the contents) PDF files. The most famous of which, of course, is the Linux edition of the Adobe Reader application, downloadable from their website. Some people think that the Adobe app is too fat, too insecure, or just prefer open source, however, so there are also a number of open-source PDF display apps as well. I commend you to Google for details.

Linux is based on Unix, so it inherits a lot of text-processing support (which is what Unix was originally designed for). There are utilities to slice, dice, reformat, scale, rotate and otherwise manipulate documents in PDF, PS, TeX, and many more text and graphics formats as well.
 
Anil Karamchandan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim

I am sorry I woke up a zombie here, but I am still not able to solve the problem, actually I am not looking for a viewer/utility by which I can view the pdf, All I am looking for is that for an user action, a pdf which is stored at some location on the server should open and the client could see the pdf and if required click on file - > save as - > ( a local copy)

I have looked on a few sites here and it seems Runtime class could be used only with windows ? or the rundell32 parameter is used only with windows. No one is clearly able to justify or give me the steps on how to achieve this.

the other way out which I have is load the document via a URL.. but I want to keep this as the last resort .


any luck ?
 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand.

A standalone application or signed applet could easily invoke a PDF viewer using the Runtime.exec() method, but you would have to know the name and location of the viewer program preferred by the user.

Rundll32 is an abomination designed to allow execution of Windows DLLs as though they were standalone applications. What's abominable about that is that A, it really shouldn't be necessary and B, you don't get an honest accounting of what apps are running in Windows when they're running under cover of rundll32. Microsoft compounded the offense with a similar utility in more recent times, but I can't (and would rather not) recall what it is. Something like svchost.exe, I think. Civilized OS's (and I don't mean only Unix-like ones) don't rely on such kludges. And of all OS's in the Universe, Windows is the very last one that should be running unidentifiable applications.
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Modern Linuxes allow the usage of the awt.Desktop-class - no need to use Runtime here. You wouldn't know whether to use xpdf, evince, acrobat or whatever.



The same approach should be used for Mac, Solaris or Windows, not rundll, which is platform-dependant.
 
reply
    Bookmark Topic Watch Topic
  • New Topic