Reputation: 2991
Before I include the code I'm working with, please know that I have tried an iframe but had a problem with displaying content inside the iframe in IE. To see what I'm talking about.. Please check out this link, in both Chrome and then Explorer: http://mrrio.github.io/jsPDF/
Also, ^ this link is exactly what I'm trying to accomplish, but so that it shows for IE as well..
<html>
<head>
<meta charset="utf-8">
<title>Display PDF in-page</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="flyer_builder.css" type="text/css" media="all">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$(function() {
$("#myDiv").load("pdf.html");
});
</script>
</head>
<body>
<div class="container-fluid flyer-builder">
<div class="col-md-6">
<a id="refresh" href="#" class="btn btn-lg btn-success">Refresh PDF</a>
</div>
<div class="col-md-6">
<div id="myDiv"></div>
</div>
</div>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script>
$(function() {
$("#refresh").click(function(evt) {
$("#myDiv").load("pdf.html")
})
})
</script>
</body>
</html>
The script in the head allows it to load on initial page load, the script towards the bottom of the body refreshes just that part of the page. This all works great in chrome, but still doesn't work in IE!!! Help please.
pdf.html: (I've used a generic pdf file for example purposes)
<object data="https://www.irs.gov/pub/irs-pdf/fw4.pdf" type="application/pdf" style="width:100%;">
<embed src="https://www.irs.gov/pub/irs-pdf/fw4.pdf" type="application/pdf"/>
</object>
Upvotes: 0
Views: 1330
Reputation: 2991
All has been solved thanks to a wonderful resource: PDFObject: http://pdfobject.com/
Generates something similar to an iframe/object-embed, but works in all IE v9+, FireFox, Chrome Browsers.
Upvotes: 1