在下面的代码中,我想在从HTML打印到pdf的每页中添加水印:
$scope.printTableFunc = function (divName) {
var printContents = document.getElementById(divName).innerHTML;
console.log(printContents)
var popupWin = window.open('', '_blank','width=1080,height=960');
popupWin.document.open();
popupWin.document.write(`
<html>
<head >
<link rel="stylesheet" type="text/css" href="../res/css/style.css" />
</head>
<body onload="window.print()">${printContents}
</body>
</html>
`);
popupWin.document.close();
}