Solved

Display PDF within a div in jsp

Posted on 2010-11-17
6
2,217 Views
Last Modified: 2012-06-27
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
Comment
Question by:mahalasa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 10

Assisted Solution

by:Hegemon
Hegemon earned 500 total points
ID: 34155510
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
 

Author Comment

by:mahalasa
ID: 34155562
i dont want to use iframe.
0
 
LVL 10

Accepted Solution

by:
Hegemon earned 500 total points
ID: 34155596
Then you have to embed it, see p.4 here: http://www.ehow.com/how_4451133_display-pdf-file-html-web.html
0
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!

 

Author Comment

by:mahalasa
ID: 34155825
not working.

If the pdf is placed in c drive how is the location specified in src="?"
0
 
LVL 10

Assisted Solution

by:Hegemon
Hegemon earned 500 total points
ID: 34155891
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
 

Author Comment

by:mahalasa
ID: 34157094
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet doXXX methods 3 81
add listbox elements from textboxes acrobat pro 1 39
Why my table column Id is not passed to java object? 4 46
jsp error 6 45
Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

756 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