Print ONLY the contents of a hidden object tag
http://stackoverflow.com/questions/14141427/print-only-the-contents-of-a-hidden-object-tag
HTML
<div id="Container">
<div class="print_this">
This only shows for the printer
<object class="print_this" id="report" name="report" type="application/pdf" data="Certificate.pdf"></object>
</div>
<div class="screen_only">
This doesn't show when printed
</div>
</div>
CSS
.print_this{
display: none;
}
@media print {
.print_this {
display: block;
width: 1024px;
height: 768px;
}
.screen_only {
display: none;
}
}
JavaScript
$(document).ready(function () {
setTimeout(function () {
var test = document.getElementById("report");
test.focus();
test.print();
}, 1500);
});