Open a pdf file in browser
-
-
Hi, I would like to open a pdf file in a web browser. I tried the below, but its not working. Please let me know how to open it.
<object type="application/pdf" data="C:\Lalitha\Bloomberg\TablesProject\Copy.pdf" width="500" height="650" ></object>
You clients browser will decide whether or not to open the pdf file or offer a download functionality, but hey! here goes the answer:
Caution here! It's never a good idea (security large hole) to offer a full file path like you have done in the orginal post which is why i changed it in my solution. Happy coding, morgs
-
You clients browser will decide whether or not to open the pdf file or offer a download functionality, but hey! here goes the answer:
Caution here! It's never a good idea (security large hole) to offer a full file path like you have done in the orginal post which is why i changed it in my solution. Happy coding, morgs
-
Thanks for your reply, Morgs.. anchor tag showing only a link. I need to open the file in the web page itself. It should not open as a separate process..
Have you tried my solution? when you click the link, the browser will open the pdf file for you in the browser, if the browser does not know how to open your file, it will offer it for download. e.g. http://www.edb.utexas.edu/minliu/multimedia/CSS.pdf[^] I don't think you are going to find any other way around this, oh well you can always try something after one thing fails. Happy coding, Morgs
-
Have you tried my solution? when you click the link, the browser will open the pdf file for you in the browser, if the browser does not know how to open your file, it will offer it for download. e.g. http://www.edb.utexas.edu/minliu/multimedia/CSS.pdf[^] I don't think you are going to find any other way around this, oh well you can always try something after one thing fails. Happy coding, Morgs
Yes, the pdf file opened in a browser.. I agree with you. But I need it in some specific area as shown in the below link. http://www.cs.tut.fi/~jkorpela/html/iframe-pdf.html[^] When I tried the same using iframe tag, its not working. Its showing blank rectangle.
<iframe src="C:\TablesProject\Copy.pdf" width="60%" style="height:10em" align="right">
the document
</iframe> -
Yes, the pdf file opened in a browser.. I agree with you. But I need it in some specific area as shown in the below link. http://www.cs.tut.fi/~jkorpela/html/iframe-pdf.html[^] When I tried the same using iframe tag, its not working. Its showing blank rectangle.
<iframe src="C:\TablesProject\Copy.pdf" width="60%" style="height:10em" align="right">
the document
</iframe>And when Acrobat Reader is configured to open as a stand alone application, you cannot do that.