@sv-print/plugin-api-image 0.2.4 → 0.2.5
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/index.js +1 -1
- package/dist/index.mjs +114 -114
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var $=(s,t,x)=>new Promise((n,f)=>{var g=o=>{try{w(x.next(o))}catch(c){f(c)}},b=o=>{try{w(x.throw(o))}catch(c){f(c)}},w=o=>o.done?n(o.value):Promise.resolve(o.value).then(g,b);w((x=x.apply(s,t)).next())});const J=require("@zumer/snapdom");(function(s,t){const x=A,n=s();for(;;)try{if(-parseInt(x(560))/1*(parseInt(x(548))/2)+parseInt(x(514))/3+-parseInt(x(521))/4+parseInt(x(501))/5+-parseInt(x(519))/6*(parseInt(x(510))/7)+-parseInt(x(493))/8+-parseInt(x(523))/9*(-parseInt(x(529))/10)===t)break;n.push(n.shift())}catch(f){n.push(n.shift())}})(B,744745);function A(s,t){const x=B();return A=function(n,f){return n=n-484,x[n]},A(s,t)}const L=function(s,t){return $(this,null,function*(){const x=A;let n=this,f=globalThis.$[x(487)](),g=!0,b=10,w=(o,c)=>{const h=x,j=Math[h(507)](o/c*100);console.log(h(488),o,h(508),c),console[h(496)]("toImage percent: ",j+"%")};if(this[x(485)][x(506)]){let o=globalThis.$[x(541)]({backgroundColor:"#fff"},t||{}),c=yield this.getHtml(s,t);t&&(t[x(547)]&&(o[x(503)]=t[x(547)]),t[x(554)]!=null&&(g=t[x(554)]),t[x(561)]!=null&&(w=t[x(561)]),t.limit!=null&&(b=t[x(555)])),globalThis.$(c)[x(530)](x(537),"").css("height",""),this.createTempContainer();let h=this[x(549)]();this[x(538)](c,o),h[x(502)](c[0]);const j=x(546);let R=h.find(j)[x(506)];globalThis.$(c)[x(530)](x(542)),this[x(552)](h,function(){const i=x;try{let m=[],D=Math[i(528)](R/b),M=R%b||1;const y=document[i(517)](i(490)),S=y[i(563)]("2d");for(let k=0;k<D;k++){const z=k==D-1&&D>1;let U=z?M:b,P=[];for(let _=0;_<U;_++){const e=k*b+_,d=h[i(525)](j)[e];d&&globalThis[i(518)].queue[i(553)](function(I){const p=i;J.snapdom[p(494)](d,o)[p(543)](function(r){const l=p;let u=r[l(563)]("2d");u[l(531)]=!1;let v=r.toDataURL("image/jpeg",o[l(520)]||.92),T=new Image;T[l(539)]=v,T.onload=function(){P[l(550)]({image:T,idx:e}),w(e+1,R),I()}})})}globalThis.hinnn[i(558)][i(553)](function(_){const e=i;P[e(533)]((r,l)=>r[e(551)]-l[e(551)]);let d=0,I=0;for(const r of P)r[e(491)][e(537)]>d&&(d=r[e(491)].width),I+=r.image.height;y[e(537)]=d,y[e(540)]=I,S[e(505)]="#fff",S.fillRect(0,0,d,I);let p=0;for(const r of P)S[e(484)](r.image,0,p,r[e(491)].width,r[e(491)][e(540)]),p+=r[e(491)][e(540)];_()}),globalThis[i(518)].queue[i(553)](function(_){const e=i;let d=o[e(536)]||"image/jpeg",I=o[e(522)]||e(544),p=o[e(520)]||.8,r=z||D==1;if(g){let l=y[e(509)](d,p),u=new Image;u.src=l,u[e(562)]=function(){const v=e;m.push({url:l,start:k*b+1,end:k*b+U}),r&&(globalThis[v(518)][v(558)][v(524)](),n[v(513)](),m[v(489)](T=>{const a=v;let C=document[a(517)]("a"),q=o.name||a(495);q[a(492)](".")==-1&&(q+=a(486));let W=q[a(556)](".")[a(499)](),O=q[a(498)]("."+W,"")+"_"+T[a(527)]+"-"+T[a(515)]+"."+W;C.style[a(534)]=a(559),C[a(516)](a(512),O),C.setAttribute(a(545),T[a(544)]),document[a(535)][a(504)](C),C[a(532)](),C[a(500)]()})),_()};return}if(I==e(544)){m[e(550)](y[e(509)](d,p)),r&&(globalThis[e(518)][e(558)][e(524)](),n[e(513)](),f[e(564)](m)),_();return}I==e(557)&&y.toBlob(function(l){const u=e;m[u(550)](l),r&&(globalThis[u(518)][u(558)][u(524)](),n.removeTempContainer(),f[u(564)](m)),_()},d,p)})}globalThis[i(518)][i(558)][i(511)]()}catch(m){console[i(565)](i(526)),console.log(m)}})}return f[x(497)]()})};function B(){const s=["1zeZnUb","onProgress","onload","getContext","resolve","error","drawImage","printPanels",".jpg","Deferred","cur","forEach","canvas","image","indexOf","11169648SDHQcW","toCanvas","download.jpg","log","promise","replace","pop","remove","7033995DPmiKW","html","dpr","appendChild","fillStyle","length","floor","total","toDataURL","7tVWzPO","run","download","removeTempContainer","2520477kBsSDz","end","setAttribute","createElement","hinnn","8155086Fykyso","quality","4489184flchqe","toType","1406655WEoubG","clear","find","toImage 失败(可能您的图片资源无法正常加载): ","start","ceil","230jzuglH","css","imageSmoothingEnabled","click","sort","display","body","type","width","svg2canvas","src","height","extend","position:fixed","then","url","href","> .hiprint-printTemplate > .hiprint-printPanel > .hiprint-printPaper","pixelRatio","2438630jZfNpI","getTempContainer","push","idx","loadAllImages","add","isDownload","limit","split","blob","queue","none"];return B=function(){return s},B()}function E(s,t){var x=H();return E=function(n,f){n=n-271;var g=x[n];return g},E(s,t)}(function(s,t){for(var x=E,n=s();;)try{var f=-parseInt(x(275))/1+-parseInt(x(271))/2+parseInt(x(278))/3+parseInt(x(274))/4*(-parseInt(x(273))/5)+-parseInt(x(279))/6+-parseInt(x(283))/7*(-parseInt(x(285))/8)+parseInt(x(277))/9;if(f===t)break;n.push(n.shift())}catch(g){n.push(n.shift())}})(H,561926);function N(s){var t=E;return{name:t(272),description:"add toImage Api",hooks:[{hook:t(282),name:t(276),description:t(276),priority:1,run:({template:x,options:n})=>{var f=t;Object[f(281)](x,f(280),{value:L,enumerable:!1,writable:!0,configurable:!0})}}],leastHiprintVersion:t(284)}}function H(){var s=["0.3.0","1533712vnUPbY","1715410rTljDB","add toImage Api","1400CvvDEl","9008CwSMNc","1113056BtkqHk","add toImage Api to PrintTemplate","20066355Cdsjmg","2940078hXjJTi","1428528eABdlk","toImage","defineProperty","newPrintTemplate","7aJIRrD"];return H=function(){return s},H()}module.exports=N;
|
package/dist/index.mjs
CHANGED
|
@@ -1,156 +1,156 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var $ = (f, t, x) => new Promise((n, s) => {
|
|
2
|
+
var g = (o) => {
|
|
3
3
|
try {
|
|
4
|
-
w(x.next(
|
|
4
|
+
w(x.next(o));
|
|
5
5
|
} catch (c) {
|
|
6
|
-
|
|
6
|
+
s(c);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, b = (o) => {
|
|
9
9
|
try {
|
|
10
|
-
w(x.throw(
|
|
10
|
+
w(x.throw(o));
|
|
11
11
|
} catch (c) {
|
|
12
|
-
|
|
12
|
+
s(c);
|
|
13
13
|
}
|
|
14
|
-
}, w = (
|
|
15
|
-
w((x = x.apply(
|
|
14
|
+
}, w = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(g, b);
|
|
15
|
+
w((x = x.apply(f, t)).next());
|
|
16
16
|
});
|
|
17
|
-
import { snapdom as
|
|
18
|
-
(function(
|
|
19
|
-
const x =
|
|
17
|
+
import { snapdom as J } from "@zumer/snapdom";
|
|
18
|
+
(function(f, t) {
|
|
19
|
+
const x = q, n = f();
|
|
20
20
|
for (; ; )
|
|
21
21
|
try {
|
|
22
|
-
if (parseInt(x(
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
22
|
+
if (-parseInt(x(560)) / 1 * (parseInt(x(548)) / 2) + parseInt(x(514)) / 3 + -parseInt(x(521)) / 4 + parseInt(x(501)) / 5 + -parseInt(x(519)) / 6 * (parseInt(x(510)) / 7) + -parseInt(x(493)) / 8 + -parseInt(x(523)) / 9 * (-parseInt(x(529)) / 10) === t) break;
|
|
23
|
+
n.push(n.shift());
|
|
24
|
+
} catch (s) {
|
|
25
|
+
n.push(n.shift());
|
|
26
26
|
}
|
|
27
|
-
})(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
})(B, 744745);
|
|
28
|
+
function q(f, t) {
|
|
29
|
+
const x = B();
|
|
30
|
+
return q = function(n, s) {
|
|
31
|
+
return n = n - 484, x[n];
|
|
32
|
+
}, q(f, t);
|
|
33
|
+
}
|
|
34
|
+
const L = function(f, t) {
|
|
35
|
+
return $(this, null, function* () {
|
|
36
|
+
const x = q;
|
|
37
|
+
let n = this, s = globalThis.$[x(487)](), g = !0, b = 10, w = (o, c) => {
|
|
38
|
+
const h = x, j = Math[h(507)](o / c * 100);
|
|
39
|
+
console.log(h(488), o, h(508), c), console[h(496)]("toImage percent: ", j + "%");
|
|
34
40
|
};
|
|
35
|
-
if (this[x(
|
|
36
|
-
let
|
|
37
|
-
t && (t[x(
|
|
38
|
-
let h = this
|
|
39
|
-
this[x(
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
globalThis.$(c)[x(
|
|
41
|
+
if (this[x(485)][x(506)]) {
|
|
42
|
+
let o = globalThis.$[x(541)]({ backgroundColor: "#fff" }, t || {}), c = yield this.getHtml(f, t);
|
|
43
|
+
t && (t[x(547)] && (o[x(503)] = t[x(547)]), t[x(554)] != null && (g = t[x(554)]), t[x(561)] != null && (w = t[x(561)]), t.limit != null && (b = t[x(555)])), globalThis.$(c)[x(530)](x(537), "").css("height", ""), this.createTempContainer();
|
|
44
|
+
let h = this[x(549)]();
|
|
45
|
+
this[x(538)](c, o), h[x(502)](c[0]);
|
|
46
|
+
const j = x(546);
|
|
47
|
+
let R = h.find(j)[x(506)];
|
|
48
|
+
globalThis.$(c)[x(530)](x(542)), this[x(552)](h, function() {
|
|
43
49
|
const i = x;
|
|
44
50
|
try {
|
|
45
|
-
let
|
|
46
|
-
const y = document[i(
|
|
47
|
-
for (let
|
|
48
|
-
const
|
|
49
|
-
let
|
|
50
|
-
for (let _ = 0; _ <
|
|
51
|
-
const e =
|
|
52
|
-
globalThis[i(
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
let
|
|
59
|
-
T
|
|
60
|
-
|
|
51
|
+
let m = [], D = Math[i(528)](R / b), M = R % b || 1;
|
|
52
|
+
const y = document[i(517)](i(490)), S = y[i(563)]("2d");
|
|
53
|
+
for (let k = 0; k < D; k++) {
|
|
54
|
+
const z = k == D - 1 && D > 1;
|
|
55
|
+
let U = z ? M : b, P = [];
|
|
56
|
+
for (let _ = 0; _ < U; _++) {
|
|
57
|
+
const e = k * b + _, d = h[i(525)](j)[e];
|
|
58
|
+
d && globalThis[i(518)].queue[i(553)](function(I) {
|
|
59
|
+
const p = i;
|
|
60
|
+
J[p(494)](d, o)[p(543)](function(r) {
|
|
61
|
+
const l = p;
|
|
62
|
+
let u = r[l(563)]("2d");
|
|
63
|
+
u[l(531)] = !1;
|
|
64
|
+
let v = r.toDataURL("image/jpeg", o[l(520)] || 0.92), T = new Image();
|
|
65
|
+
T[l(539)] = v, T.onload = function() {
|
|
66
|
+
P[l(550)]({ image: T, idx: e }), w(e + 1, R), I();
|
|
61
67
|
};
|
|
62
68
|
});
|
|
63
69
|
});
|
|
64
70
|
}
|
|
65
|
-
globalThis[i(
|
|
71
|
+
globalThis.hinnn[i(558)][i(553)](function(_) {
|
|
66
72
|
const e = i;
|
|
67
|
-
|
|
68
|
-
let
|
|
69
|
-
for (const r of
|
|
70
|
-
r[e(
|
|
71
|
-
y[e(
|
|
72
|
-
let
|
|
73
|
-
for (const r of
|
|
74
|
-
|
|
73
|
+
P[e(533)]((r, l) => r[e(551)] - l[e(551)]);
|
|
74
|
+
let d = 0, I = 0;
|
|
75
|
+
for (const r of P)
|
|
76
|
+
r[e(491)][e(537)] > d && (d = r[e(491)].width), I += r.image.height;
|
|
77
|
+
y[e(537)] = d, y[e(540)] = I, S[e(505)] = "#fff", S.fillRect(0, 0, d, I);
|
|
78
|
+
let p = 0;
|
|
79
|
+
for (const r of P)
|
|
80
|
+
S[e(484)](r.image, 0, p, r[e(491)].width, r[e(491)][e(540)]), p += r[e(491)][e(540)];
|
|
75
81
|
_();
|
|
76
|
-
}), globalThis[i(
|
|
82
|
+
}), globalThis[i(518)].queue[i(553)](function(_) {
|
|
77
83
|
const e = i;
|
|
78
|
-
let
|
|
79
|
-
if (
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
let
|
|
88
|
-
|
|
84
|
+
let d = o[e(536)] || "image/jpeg", I = o[e(522)] || e(544), p = o[e(520)] || 0.8, r = z || D == 1;
|
|
85
|
+
if (g) {
|
|
86
|
+
let l = y[e(509)](d, p), u = new Image();
|
|
87
|
+
u.src = l, u[e(562)] = function() {
|
|
88
|
+
const v = e;
|
|
89
|
+
m.push({ url: l, start: k * b + 1, end: k * b + U }), r && (globalThis[v(518)][v(558)][v(524)](), n[v(513)](), m[v(489)]((T) => {
|
|
90
|
+
const a = v;
|
|
91
|
+
let C = document[a(517)]("a"), A = o.name || a(495);
|
|
92
|
+
A[a(492)](".") == -1 && (A += a(486));
|
|
93
|
+
let W = A[a(556)](".")[a(499)](), O = A[a(498)]("." + W, "") + "_" + T[a(527)] + "-" + T[a(515)] + "." + W;
|
|
94
|
+
C.style[a(534)] = a(559), C[a(516)](a(512), O), C.setAttribute(a(545), T[a(544)]), document[a(535)][a(504)](C), C[a(532)](), C[a(500)]();
|
|
89
95
|
})), _();
|
|
90
96
|
};
|
|
91
97
|
return;
|
|
92
98
|
}
|
|
93
|
-
if (
|
|
94
|
-
|
|
99
|
+
if (I == e(544)) {
|
|
100
|
+
m[e(550)](y[e(509)](d, p)), r && (globalThis[e(518)][e(558)][e(524)](), n[e(513)](), s[e(564)](m)), _();
|
|
95
101
|
return;
|
|
96
102
|
}
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
},
|
|
103
|
+
I == e(557) && y.toBlob(function(l) {
|
|
104
|
+
const u = e;
|
|
105
|
+
m[u(550)](l), r && (globalThis[u(518)][u(558)][u(524)](), n.removeTempContainer(), s[u(564)](m)), _();
|
|
106
|
+
}, d, p);
|
|
101
107
|
});
|
|
102
108
|
}
|
|
103
|
-
globalThis[i(
|
|
104
|
-
} catch (
|
|
105
|
-
console[i(
|
|
109
|
+
globalThis[i(518)][i(558)][i(511)]();
|
|
110
|
+
} catch (m) {
|
|
111
|
+
console[i(565)](i(526)), console.log(m);
|
|
106
112
|
}
|
|
107
113
|
});
|
|
108
114
|
}
|
|
109
|
-
return
|
|
115
|
+
return s[x(497)]();
|
|
110
116
|
});
|
|
111
117
|
};
|
|
112
|
-
function
|
|
113
|
-
const
|
|
114
|
-
return
|
|
115
|
-
return
|
|
116
|
-
},
|
|
117
|
-
}
|
|
118
|
-
function D(s, t) {
|
|
119
|
-
const x = j();
|
|
120
|
-
return D = function(a, l) {
|
|
121
|
-
return a = a - 362, x[a];
|
|
122
|
-
}, D(s, t);
|
|
118
|
+
function B() {
|
|
119
|
+
const f = ["1zeZnUb", "onProgress", "onload", "getContext", "resolve", "error", "drawImage", "printPanels", ".jpg", "Deferred", "cur", "forEach", "canvas", "image", "indexOf", "11169648SDHQcW", "toCanvas", "download.jpg", "log", "promise", "replace", "pop", "remove", "7033995DPmiKW", "html", "dpr", "appendChild", "fillStyle", "length", "floor", "total", "toDataURL", "7tVWzPO", "run", "download", "removeTempContainer", "2520477kBsSDz", "end", "setAttribute", "createElement", "hinnn", "8155086Fykyso", "quality", "4489184flchqe", "toType", "1406655WEoubG", "clear", "find", "toImage 失败(可能您的图片资源无法正常加载): ", "start", "ceil", "230jzuglH", "css", "imageSmoothingEnabled", "click", "sort", "display", "body", "type", "width", "svg2canvas", "src", "height", "extend", "position:fixed", "then", "url", "href", "> .hiprint-printTemplate > .hiprint-printPanel > .hiprint-printPaper", "pixelRatio", "2438630jZfNpI", "getTempContainer", "push", "idx", "loadAllImages", "add", "isDownload", "limit", "split", "blob", "queue", "none"];
|
|
120
|
+
return B = function() {
|
|
121
|
+
return f;
|
|
122
|
+
}, B();
|
|
123
123
|
}
|
|
124
|
-
function E(
|
|
125
|
-
var x =
|
|
126
|
-
return E = function(
|
|
127
|
-
|
|
128
|
-
var
|
|
129
|
-
return
|
|
130
|
-
}, E(
|
|
124
|
+
function E(f, t) {
|
|
125
|
+
var x = H();
|
|
126
|
+
return E = function(n, s) {
|
|
127
|
+
n = n - 271;
|
|
128
|
+
var g = x[n];
|
|
129
|
+
return g;
|
|
130
|
+
}, E(f, t);
|
|
131
131
|
}
|
|
132
|
-
(function(
|
|
133
|
-
for (var x = E,
|
|
132
|
+
(function(f, t) {
|
|
133
|
+
for (var x = E, n = f(); ; )
|
|
134
134
|
try {
|
|
135
|
-
var
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
} catch (
|
|
139
|
-
|
|
135
|
+
var s = -parseInt(x(275)) / 1 + -parseInt(x(271)) / 2 + parseInt(x(278)) / 3 + parseInt(x(274)) / 4 * (-parseInt(x(273)) / 5) + -parseInt(x(279)) / 6 + -parseInt(x(283)) / 7 * (-parseInt(x(285)) / 8) + parseInt(x(277)) / 9;
|
|
136
|
+
if (s === t) break;
|
|
137
|
+
n.push(n.shift());
|
|
138
|
+
} catch (g) {
|
|
139
|
+
n.push(n.shift());
|
|
140
140
|
}
|
|
141
|
-
})(
|
|
142
|
-
function Z(
|
|
141
|
+
})(H, 561926);
|
|
142
|
+
function Z(f) {
|
|
143
143
|
var t = E;
|
|
144
|
-
return { name: t(
|
|
145
|
-
var
|
|
146
|
-
Object[
|
|
147
|
-
} }], leastHiprintVersion: t(
|
|
144
|
+
return { name: t(272), description: "add toImage Api", hooks: [{ hook: t(282), name: t(276), description: t(276), priority: 1, run: ({ template: x, options: n }) => {
|
|
145
|
+
var s = t;
|
|
146
|
+
Object[s(281)](x, s(280), { value: L, enumerable: !1, writable: !0, configurable: !0 });
|
|
147
|
+
} }], leastHiprintVersion: t(284) };
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
var
|
|
151
|
-
return
|
|
152
|
-
return
|
|
153
|
-
},
|
|
149
|
+
function H() {
|
|
150
|
+
var f = ["0.3.0", "1533712vnUPbY", "1715410rTljDB", "add toImage Api", "1400CvvDEl", "9008CwSMNc", "1113056BtkqHk", "add toImage Api to PrintTemplate", "20066355Cdsjmg", "2940078hXjJTi", "1428528eABdlk", "toImage", "defineProperty", "newPrintTemplate", "7aJIRrD"];
|
|
151
|
+
return H = function() {
|
|
152
|
+
return f;
|
|
153
|
+
}, H();
|
|
154
154
|
}
|
|
155
155
|
export {
|
|
156
156
|
Z as default
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_,d){typeof exports=="object"&&typeof module!="undefined"?module.exports=d(require("@zumer/snapdom")):typeof define=="function"&&define.amd?define(["@zumer/snapdom"],d):(_=typeof globalThis!="undefined"?globalThis:_||self,_.pluginApiImage=d(_.window))})(this,function(_){"use strict";var J=(_,d,j)=>new Promise((k,T)=>{var R=t=>{try{i(j.next(t))}catch(x){T(x)}},C=t=>{try{i(j.throw(t))}catch(x){T(x)}},i=t=>t.done?k(t.value):Promise.resolve(t.value).then(R,C);i((j=j.apply(_,d)).next())});(function(i,t){const x=d,n=i();for(;;)try{if(-parseInt(x(560))/1*(parseInt(x(548))/2)+parseInt(x(514))/3+-parseInt(x(521))/4+parseInt(x(501))/5+-parseInt(x(519))/6*(parseInt(x(510))/7)+-parseInt(x(493))/8+-parseInt(x(523))/9*(-parseInt(x(529))/10)===t)break;n.push(n.shift())}catch(f){n.push(n.shift())}})(k,744745);function d(i,t){const x=k();return d=function(n,f){return n=n-484,x[n]},d(i,t)}const j=function(i,t){return J(this,null,function*(){const x=d;let n=this,f=globalThis.$[x(487)](),D=!0,v=10,W=(l,w)=>{const h=x,z=Math[h(507)](l/w*100);console.log(h(488),l,h(508),w),console[h(496)]("toImage percent: ",z+"%")};if(this[x(485)][x(506)]){let l=globalThis.$[x(541)]({backgroundColor:"#fff"},t||{}),w=yield this.getHtml(i,t);t&&(t[x(547)]&&(l[x(503)]=t[x(547)]),t[x(554)]!=null&&(D=t[x(554)]),t[x(561)]!=null&&(W=t[x(561)]),t.limit!=null&&(v=t[x(555)])),globalThis.$(w)[x(530)](x(537),"").css("height",""),this.createTempContainer();let h=this[x(549)]();this[x(538)](w,l),h[x(502)](w[0]);const z=x(546);let S=h.find(z)[x(506)];globalThis.$(w)[x(530)](x(542)),this[x(552)](h,function(){const a=x;try{let m=[],B=Math[a(528)](S/v),L=S%v||1;const P=document[a(517)](a(490)),U=P[a(563)]("2d");for(let A=0;A<B;A++){const $=A==B-1&&B>1;let M=$?L:v,E=[];for(let b=0;b<M;b++){const e=A*v+b,c=h[a(525)](z)[e];c&&globalThis[a(518)].queue[a(553)](function(g){const p=a;_.snapdom[p(494)](c,l)[p(543)](function(r){const s=p;let u=r[s(563)]("2d");u[s(531)]=!1;let I=r.toDataURL("image/jpeg",l[s(520)]||.92),y=new Image;y[s(539)]=I,y.onload=function(){E[s(550)]({image:y,idx:e}),W(e+1,S),g()}})})}globalThis.hinnn[a(558)][a(553)](function(b){const e=a;E[e(533)]((r,s)=>r[e(551)]-s[e(551)]);let c=0,g=0;for(const r of E)r[e(491)][e(537)]>c&&(c=r[e(491)].width),g+=r.image.height;P[e(537)]=c,P[e(540)]=g,U[e(505)]="#fff",U.fillRect(0,0,c,g);let p=0;for(const r of E)U[e(484)](r.image,0,p,r[e(491)].width,r[e(491)][e(540)]),p+=r[e(491)][e(540)];b()}),globalThis[a(518)].queue[a(553)](function(b){const e=a;let c=l[e(536)]||"image/jpeg",g=l[e(522)]||e(544),p=l[e(520)]||.8,r=$||B==1;if(D){let s=P[e(509)](c,p),u=new Image;u.src=s,u[e(562)]=function(){const I=e;m.push({url:s,start:A*v+1,end:A*v+M}),r&&(globalThis[I(518)][I(558)][I(524)](),n[I(513)](),m[I(489)](y=>{const o=I;let q=document[o(517)]("a"),H=l.name||o(495);H[o(492)](".")==-1&&(H+=o(486));let O=H[o(556)](".")[o(499)](),N=H[o(498)]("."+O,"")+"_"+y[o(527)]+"-"+y[o(515)]+"."+O;q.style[o(534)]=o(559),q[o(516)](o(512),N),q.setAttribute(o(545),y[o(544)]),document[o(535)][o(504)](q),q[o(532)](),q[o(500)]()})),b()};return}if(g==e(544)){m[e(550)](P[e(509)](c,p)),r&&(globalThis[e(518)][e(558)][e(524)](),n[e(513)](),f[e(564)](m)),b();return}g==e(557)&&P.toBlob(function(s){const u=e;m[u(550)](s),r&&(globalThis[u(518)][u(558)][u(524)](),n.removeTempContainer(),f[u(564)](m)),b()},c,p)})}globalThis[a(518)][a(558)][a(511)]()}catch(m){console[a(565)](a(526)),console.log(m)}})}return f[x(497)]()})};function k(){const i=["1zeZnUb","onProgress","onload","getContext","resolve","error","drawImage","printPanels",".jpg","Deferred","cur","forEach","canvas","image","indexOf","11169648SDHQcW","toCanvas","download.jpg","log","promise","replace","pop","remove","7033995DPmiKW","html","dpr","appendChild","fillStyle","length","floor","total","toDataURL","7tVWzPO","run","download","removeTempContainer","2520477kBsSDz","end","setAttribute","createElement","hinnn","8155086Fykyso","quality","4489184flchqe","toType","1406655WEoubG","clear","find","toImage 失败(可能您的图片资源无法正常加载): ","start","ceil","230jzuglH","css","imageSmoothingEnabled","click","sort","display","body","type","width","svg2canvas","src","height","extend","position:fixed","then","url","href","> .hiprint-printTemplate > .hiprint-printPanel > .hiprint-printPaper","pixelRatio","2438630jZfNpI","getTempContainer","push","idx","loadAllImages","add","isDownload","limit","split","blob","queue","none"];return k=function(){return i},k()}function T(i,t){var x=C();return T=function(n,f){n=n-271;var D=x[n];return D},T(i,t)}(function(i,t){for(var x=T,n=i();;)try{var f=-parseInt(x(275))/1+-parseInt(x(271))/2+parseInt(x(278))/3+parseInt(x(274))/4*(-parseInt(x(273))/5)+-parseInt(x(279))/6+-parseInt(x(283))/7*(-parseInt(x(285))/8)+parseInt(x(277))/9;if(f===t)break;n.push(n.shift())}catch(D){n.push(n.shift())}})(C,561926);function R(i){var t=T;return{name:t(272),description:"add toImage Api",hooks:[{hook:t(282),name:t(276),description:t(276),priority:1,run:({template:x,options:n})=>{var f=t;Object[f(281)](x,f(280),{value:j,enumerable:!1,writable:!0,configurable:!0})}}],leastHiprintVersion:t(284)}}function C(){var i=["0.3.0","1533712vnUPbY","1715410rTljDB","add toImage Api","1400CvvDEl","9008CwSMNc","1113056BtkqHk","add toImage Api to PrintTemplate","20066355Cdsjmg","2940078hXjJTi","1428528eABdlk","toImage","defineProperty","newPrintTemplate","7aJIRrD"];return C=function(){return i},C()}return R});
|