Opening a PDF file from a Servlet

Posted on 2005-04-25
Medium Priority
Last Modified: 2013-11-24
I have a PDF file which I want to render to my client.

Once the request come how can read the file from underlying O/S like c:/temp/a.pdf and then render him back ...

Thanx in advance,

Question by:rahulkothari
  • 4
LVL 86

Accepted Solution

CEHJ earned 1000 total points
ID: 13861244
You need to set the right mime type for the response. See


Author Comment

ID: 13861345
how about using HttpClient ... let know your views ...

LVL 86

Expert Comment

ID: 13861375
Is the client a browser? If it isn't, you're going to have to find either something to plug in to your gui, or run something like Adobe to view it
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 86

Expert Comment

ID: 13861379
(HttpClient is non-gui software)
LVL 92

Expert Comment

ID: 13863348
You can use Runtime.exec() to invoke a PDF viewer. Try command something like:

cmd /c start c:\temp\a.pdf
LVL 86

Expert Comment

ID: 13866717

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses
Course of the Month9 days, 16 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question