OCPJP 6, IBM DB2, IBM RAD Certified
http://javawithsachin.blogspot.in/
Thakur Sachin Singh wrote:some pdf viewer software give plugin for browser to display pdf on any browser....try foxit pdf viewer or adobe
OCPJP 6, IBM DB2, IBM RAD Certified
http://javawithsachin.blogspot.in/
Yes it can be done, we just have to figure out how.
Anurag Verma wrote:if your question is something like you have a pdf on server & you want to display it on client machine's browser, then you have to do the following -
set response header Content-Disposition as inline
set response header Content-Type as application/pdf
After this, write your pdf file into the response.
you can use it directly or can use an iframe to display it within your web page. Hope that answers
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Yes it can be done, we just have to figure out how.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Oracle certified JPA Developer (1Z0-898),Oracle certified Java 8 Programmer I (1Z0-808), Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I, CIW Certified Ecommerce specialist
rakhi sinha wrote:
Anurag Verma wrote:if your question is something like you have a pdf on server & you want to display it on client machine's browser, then you have to do the following -
set response header Content-Disposition as inline
set response header Content-Type as application/pdf
After this, write your pdf file into the response.
you can use it directly or can use an iframe to display it within your web page. Hope that answers
I have used this also but problem is not solved....
Bear Bibeault wrote:Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
I've gone ahead and added the code tags for you. See how much easier the code is to read?
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Tim Holloway wrote:You should NEVER attempt to write to your WAR. It isn't supported by the J2EE spec,it isn't guaranteed to work (getRealPath may return NULL), and you can lose important data when a new version of the WAR is deployed.
It is OK to READ signatures and model PDF files from within a WAR, but not to write or update. Officially, a WAR is a ZIP (JAR) format file, and you cannot open a member of a ZIP file for reading or writing the way you can do for an independent file. You cannot even reliably read the resource using getRealPath() for that reason, which is why there's a "getResourceAsStream()" method that handles that situation.
Always write to a location that's external both to the webapp (WAR) and to the webapp server.
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|