Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

[[qanda:topic_unsolved]] I need to print the content of the html sub-page and how to write the code

$
0
0

In the process of developing qwebwngine, I need to call subpage printing.
parent html code

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<iframe src="print.html" id="printf" name="printf" frameborder="0" width="200"></iframe>
<input type="button" value="print child" onclick="document.getElementById('printf').contentWindow.prints();" />
</body>
</html>

child html code

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>

<body>
    <p>child page!</p>
    <div id="name">im child page!</div>
<script>
function prints(){
	window.print();
}
</script>
</body>
</html>

I need to print the content of the sub-page and how to write the code,
Do not print the buttons on the parent page.


Viewing all articles
Browse latest Browse all 13965

Trending Articles