ztxkutils 2.10.11 → 2.10.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/print.js +5 -5
- package/package.json +1 -1
package/dist/print.js
CHANGED
@@ -78,13 +78,13 @@ function createWaterHandle(obj) {
|
|
78
78
|
}
|
79
79
|
var _a = obj || {}, waterText = _a.waterText, opacity = _a.opacity, fontSize = _a.fontSize, cavansWidth = _a.cavansWidth, cavansHeight = _a.cavansHeight;
|
80
80
|
var canvas = document.createElement('canvas');
|
81
|
-
canvas.width = cavansWidth ||
|
82
|
-
canvas.height = cavansHeight ||
|
81
|
+
canvas.width = cavansWidth || 240;
|
82
|
+
canvas.height = cavansHeight || 100;
|
83
83
|
var ctx = canvas.getContext('2d');
|
84
84
|
if (ctx) {
|
85
85
|
ctx.rotate((-10 * Math.PI) / 180); // 水印旋转角度
|
86
86
|
ctx.font = (fontSize || '18px') + " \u5FAE\u8F6F\u96C5\u9ED1";
|
87
|
-
ctx.fillStyle = "rgba(0,0,0," + (opacity ? opacity : '0.
|
87
|
+
ctx.fillStyle = "rgba(0,0,0," + (opacity ? opacity : '0.07') + ")";
|
88
88
|
ctx.textAlign = 'center';
|
89
89
|
ctx.textBaseline = 'middle';
|
90
90
|
ctx.fillText(waterText || defaultWaterText, canvas.width / 2, canvas.height); // 水印在画布的位置x,y轴
|
@@ -119,7 +119,7 @@ function createPdf(canvas, pdf, noWater, positionX) {
|
|
119
119
|
pdf.addImage(pageData, 'JPEG', positionX || 20, 10, imgWidth, imgHeight);
|
120
120
|
if (!noWater) {
|
121
121
|
var waterBase64 = createWaterHandle({
|
122
|
-
opacity: '0.
|
122
|
+
opacity: '0.07',
|
123
123
|
fontSize: '14px',
|
124
124
|
});
|
125
125
|
addPdfWaterHandle(pdf, waterBase64);
|
@@ -130,7 +130,7 @@ function createPdf(canvas, pdf, noWater, positionX) {
|
|
130
130
|
pdf.addImage(pageData, 'JPEG', positionX || 20, position, imgWidth, imgHeight);
|
131
131
|
if (!noWater) {
|
132
132
|
var waterBase64 = createWaterHandle({
|
133
|
-
opacity: '0.
|
133
|
+
opacity: '0.07',
|
134
134
|
fontSize: '14px',
|
135
135
|
});
|
136
136
|
addPdfWaterHandle(pdf, waterBase64);
|