Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2667
  • Last Modified:

Display PDF within a div in jsp

I need to display the contents of a pdf read from local drive in a div in jsp. something like one below
<div>
Some text
</div>
<div>
pdf contents
</div>
<div>
some text
</div>

Any quick help with code snippet would be highly apprciated.
0
mahalasa
Asked:
mahalasa
  • 3
  • 3
3 Solutions
 
HegemonCommented:
PDF is one format, HTML is another. You cannot embed PDF directly into HTML.
You can try playing with iframes where you would be displaying an iframe in the div. The target of the iframe would be a URL pointing to the PDF.

0
 
mahalasaAuthor Commented:
i dont want to use iframe.
0
 
HegemonCommented:
Then you have to embed it, see p.4 here: http://www.ehow.com/how_4451133_display-pdf-file-html-web.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
mahalasaAuthor Commented:
not working.

If the pdf is placed in c drive how is the location specified in src="?"
0
 
HegemonCommented:
See live example here http://blogs.adobe.com/pdfdevjunkie/2007/08/using_the_html_embed_tag_to_di.html
Naturally you cannot display the content of a local file to the external web user as the file is local !
Either it needs to be placed into a location available to the web server or you will need a servlet reading the content of the file and streaming it to the client. The URL in this case will be that of the servlet.
0
 
mahalasaAuthor Commented:
oops...it was my mistake...it did work with local drive as i am working on dev env. Thanks.
The way in which i was speciying location was wrong. forgot to use html rewrite tag.

Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now