Viewing a remote PDF file

H

Hakan Lane

The application should fetch a PDF file from a web server and display
it to the user. The file will have been generated elsewhere, so I just
need to be able to view it and send it to a local printer. Do I need to
download an external package to do that? If so, it would be nice to know
which one is reasonably straightforward to integrate. Please note the
separate functions of acessing a remote file and displaying it in the
application. Thanks in advance.

Regards.
 
K

Knute Johnson

Hakan said:
The application should fetch a PDF file from a web server and display it
to the user. The file will have been generated elsewhere, so I just need
to be able to view it and send it to a local printer. Do I need to
download an external package to do that? If so, it would be nice to know
which one is reasonably straightforward to integrate. Please note the
separate functions of acessing a remote file and displaying it in the
application. Thanks in advance.

Regards.

Web browsers do that? You need to have Acrobat installed.
 
J

Jacob

Hakan said:
The application should fetch a PDF file from a web server and display it
to the user. The file will have been generated elsewhere, so I just need
to be able to view it and send it to a local printer. Do I need to
download an external package to do that? If so, it would be nice to know
which one is reasonably straightforward to integrate. Please note the
separate functions of acessing a remote file and displaying it in the
application. Thanks in advance.

Just identify your file as either a java.io.File or a java.net.URI
instance and you can display it directly using:

Desktop.getDesktop().browse(uri); // or file.toURI()

I am not sure if you can print it programatically from your java app,
the user probably needs to push the browser print button.
 
H

H.L

Just identify your file as either a java.io.File or a java.net.URI
instance and you can display it directly using:

Desktop.getDesktop().browse(uri); // or file.toURI()

I am not sure if you can print it programatically from your java app,
the user probably needs to push the browser print button.

Thank you for the tip. The problem is that I am working with Netbeans
5.5.1, which dopes not support Java 1.6 . Would you know how to do it in
Java 1.5 environments?

Regards.
 
A

Andrew Thompson

 ...The problem is that I am working with Netbeans
5.5.1, which dopes not support Java 1.6 .

No. The 'problem' is that apparently you do not know
how to use the IDE. NetBeans supports Ant, and Ant
can compile for a later version of Java than is used
in the IDE.

But more important than what your IDE supports, what
minimum level of Java runtime is this code aimed at?
 
L

Lew

Andrew said:
No. The 'problem' is that apparently you do not know
how to use the IDE. NetBeans supports Ant, and Ant
can compile for a later version of Java than is used
in the IDE.

But more important than what your IDE supports, what
minimum level of Java runtime is this code aimed at?

Besides, NetBeans 6.x is just a free download away.
 
R

Roedy Green

The application should fetch a PDF file from a web server and display
it to the user. The file will have been generated elsewhere, so I just
need to be able to view it and send it to a local printer. Do I need to
download an external package to do that? If so, it would be nice to know
which one is reasonably straightforward to integrate. Please note the
separate functions of acessing a re

for tools to manipulate your pdf file without using Acrobat, see
http://mindprod.com/jgloss/pdf.html
and chase the links.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top