Solved

Display PDF within a div in jsp

Posted on 2010-11-17
6
2,178 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

860 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