This example demonstrates how to embed an PDF file into an HTML document.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<style>
/*
--------------------------------------------------------------------------
Embeded PDF styles
--------------------------------------------------------------------------
*/
/* make pdf viewer height stretch to 100% of the containing element,
all parent elements must have their height set to 100%.
https://stackoverflow.com/a/8473234 */
html,
body,
.container,
object {
height: 100%;
}
object {
width: 100%;
}
/*
--------------------------------------------------------------------------
Page specfic styles
--------------------------------------------------------------------------
*/
pre {
background-color: #ccc;
border: 1px solid #999;
}
</style>
</head>
<body>
<header>
<h1>Embeded PDF using the <code><object></code> Tag <small>(Standard markup, no JavaScript)</small></h1>
<blockquote>
<p>
Unlike <code><embed></code>, the <code><object></code> element
enables you to leave fallback content if the browser doesn't support PDF
embedding. All browsers support the <code><object></code> element,
however, there are often discrepancies in how it has been implemented in each
browser. Be sure to throughly test your page(s) across browsers and operating
systems if you use the <code><object></code> element. - <a href="https://pdfobject.com/static/" rel="external">Embedding PDFs without using JavaScript</a>
</p>
</blockquote>
<h2>Code</h2>
<pre>
<code>
<object data='example_1.pdf#page=1&view=FitB&scrollbar=0&toolbar=1&pagemode=bookmarks&statusbar=0&messages=1&navpanes=1' type='application/pdf'>
<p>
This browser does not support inline PDFs. Please download the PDF to view it:
<a href="example_1.pdf">Download PDF</a>
</p>
</object>
</code>
</pre>
</header>
<div class="container">
<h2>Example</h2>
<p>Options configured using the <a href="https://pdfobject.com/generator/">PDFObject.js Code Generator</a>.</p>
<object data='example_1.pdf#page=1&view=FitB&scrollbar=0&toolbar=1&pagemode=bookmarks&statusbar=0&messages=1&navpanes=1' type='application/pdf'>
<p>
This browser does not support inline PDFs. Please download the PDF to view it:
<a href="example_1.pdf">Download PDF</a>
</p>
</object>
</div>
</body>
</html>