WebEngine Widgets PrintMe Example▲
Sélectionnez
&
lt;!
doctype html&
gt;
&
lt;html lang=
"en"
&
gt;
&
lt;head&
gt;
&
lt;meta charset=
"utf-8"
&
gt;
&
lt;title&
gt;PrintMe&
lt;/
title&
gt;
&
lt;link rel=
"stylesheet"
type=
"text/css"
href=
"style.css"
&
gt;
&
lt;script&
gt;
function printNow() {
window.print();
}
&
lt;/
script&
gt;
&
lt;/
head&
gt;
&
lt;body&
gt;
&
lt;form class
=
"form"
&
gt;
&
lt;img class
=
"logo"
src=
"icon.svg"
alt=
"qtwebengine"
&
gt;
&
lt;div class
=
"header"
&
gt;
&
lt;h1&
gt;Hello Paper World!&
lt;/
h1&
gt;
&
lt;h2&
gt;Press Ctrl+
p to print with print preview&
lt;/
h2&
gt;
&
lt;h2&
gt;Press Ctrl+
Shift+
p to print without print preview&
lt;/
h2&
gt;
&
lt;h2&
gt;Click the button to print using
JavaScript&
lt;/
h2&
gt;
&
lt;p class
=
"button"
onclick=
"printNow()"
&
gt;Print Now&
lt;/
p&
gt;
&
lt;/
form&
gt;
&
lt;/
body&
gt;
&
lt;/
html&
gt;