新功能点:支持全局水印
This commit is contained in:
@ -6,10 +6,13 @@
|
||||
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0">
|
||||
<title>PDF预览</title>
|
||||
<style type="text/css">
|
||||
body{
|
||||
* {
|
||||
margin: 0;
|
||||
padding:0;
|
||||
border:0;
|
||||
padding: 0;
|
||||
}
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@ -25,6 +28,7 @@
|
||||
|
||||
|
||||
</body>
|
||||
<script src="js/watermark.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
document.getElementsByTagName('iframe')[0].src = "${baseUrl}pdfjs/web/viewer.html?base=${baseUrl}&file="+encodeURIComponent('${finalUrl}');
|
||||
document.getElementsByTagName('iframe')[0].height = document.documentElement.clientHeight-10;
|
||||
@ -45,5 +49,27 @@
|
||||
}
|
||||
window.location.href=url;
|
||||
}
|
||||
/*初始化水印*/
|
||||
window.onload = function() {
|
||||
var watermarkTxt = '${watermarkTxt}';
|
||||
if (watermarkTxt !== '') {
|
||||
watermark.init({
|
||||
watermark_txt: '${watermarkTxt}',
|
||||
watermark_x: 0,
|
||||
watermark_y: 0,
|
||||
watermark_rows: 0,
|
||||
watermark_cols: 0,
|
||||
watermark_x_space: ${watermarkXSpace},
|
||||
watermark_y_space: ${watermarkYSpace},
|
||||
watermark_font: '${watermarkFont}',
|
||||
watermark_fontsize: '${watermarkFontsize}',
|
||||
watermark_color:'${watermarkColor}',
|
||||
watermark_alpha: ${watermarkAlpha},
|
||||
watermark_width: ${watermarkWidth},
|
||||
watermark_height: ${watermarkHeight},
|
||||
watermark_angle: ${watermarkAngle},
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user