The issue is related to printing the content in the iframe from the normal HTML file.
I have created an HTML file where I am just including an Iframe and passing the src with the online sample PDF file URL(for testing purpose). But after the HTML file is loaded and I tried to print the page using Ctrl + P, the page is printed without the iframe file.
I don't want to add a button to the HTML which will print the content of the iframe. I want to print the iframe content directly from the parent window.
<!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>
<title>My Page</title>
<style type="text/css">
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
#content {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0px;
}
</style>
</head>
<body>
<div id="content">
<iframe id="printf" name="printf" src="http://www.africau.edu/images/default/sample.pdf" width="100%" height="98%" frameborder="0" allowfullscreen></iframe>
</div>
</body>
</html>
Any ideas on how to achieve this?
The result prints the outer page and not the content within the iframe.