Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display pdf content in web page using html5 and jquery?

Tags:

How to display pdf document inside my div. I am using HTML5 and jquery to build my mobile site. I need to display my pdf document inside a Turnjs div need to flip pages and go to specific page

like image 581
raghul Avatar asked Oct 26 '12 09:10

raghul


People also ask

How do I embed a PDF in HTML5?

To embed a PDF file in an HTML5 page, use the <iframe> element.

How do I embed a PDF in a Web page?

Using an iframe tag is the second way to embed a pdf file in an HTML web page. In web development, web developers use the iframe tag to embed files in various formats and even other websites within a web page. Due to its wide compatibility, the iframe tag is widely used for embedding pdf.

How do I display a PDF in iframe?

All you need to do is add #view=fitH to the end of the source attribute. That's it! fitH stands for fit horizontal, and this will make the PDF in our iframe fit the width of the screen.

How do I display a PDF file in HTML?

To embed the PDF in the HTML window, point the page to a document and then specify the height and width of the PDF so the HTML window is the correct size using the code: <embed src="filename. pdf" width="500" height="375">. Note that an embedded PDF may look very different on different browsers and operating systems.


1 Answers

<div> <object data="test.pdf" type="application/pdf" width="300" height="200"> alt : <a href="test.pdf">test.pdf</a> </object> </div>  

Read this thread - http://www.webdeveloper.com/forum/showthread.php?152923-PDF-within-a-DIV

like image 157
Dipak Avatar answered Sep 26 '22 09:09

Dipak