I have a question regarding auto printing a pdf inside a iframe
Can it be done?
My code/html looks like this at the moment. But i haven´t got at print to test it at the moment
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Print af opgaver | Cirkus Summarum DR Big Bandet & Muskelsvind Fonden</title>
<style type="text/css">
* {
margin:0;
padding:0;
}
html, body {
height:100%;
width:100%;
overflow:hidden;
background:#fff;
}
</style>
<script>
function printPDF() {
frame = document.getElementById("printpdf");
framedoc = frame.contentWindow;
framedoc.focus();
framedoc.print();
}
function executePrint() {
setTimeout( printPDF, 2000 )
}
window.onload = executePrint;
</script>
</head>
<body>
<div style="width:100%; height:100%;">
<iframe id="printpdf" src="/images/cirkussummarum/pdf/Cirkusopgaver.pdf" frameborder="0" width="100%" height="100%"></iframe>
</div>
</body>
</html>