@sv-print/plugin-api-pdf3 0.1.0 → 0.1.1
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/README.md +51 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +94 -94
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @sv-print/plugin-api-pdf3
|
|
2
|
+
|
|
3
|
+
给 sv-print 提供导出 PDF 的 API 插件。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sv-print/plugin-api-pdf3
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import pluginApiPdf from "@sv-print/plugin-api-pdf3";
|
|
13
|
+
const plugins = [pluginApiPdf({})];
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 示例
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
let hiprintTemplate = new hiprint.PrintTemplate(options);
|
|
20
|
+
// 其中 “text” 是一个元素的 “字段名(field)”
|
|
21
|
+
let printData = { text: "这是打印时显示的文本" };
|
|
22
|
+
const res = await hiprintTemplate.toPdf(printData, "pdf名称", {
|
|
23
|
+
isDownload: false, // 不自动下载
|
|
24
|
+
type: "blob", // 默认 blob 支持: blob、bloburl、pdfobjectnewwindow、dataurl --> jspdf.output(type)
|
|
25
|
+
onProgress: (cur, total) => {
|
|
26
|
+
const percent = Math.floor((cur / total) * 100);
|
|
27
|
+
console.log("toPdf 进度", percent);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
console.log("toPdf", res);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
LGPL
|
|
36
|
+
|
|
37
|
+
### 开源使用须知
|
|
38
|
+
|
|
39
|
+
1.请自觉遵守 LGPL 协议,其他用途可联系作者;
|
|
40
|
+
|
|
41
|
+
2.允许用于个人学习、毕业设计、教学案例、公益事业、商业使用;
|
|
42
|
+
|
|
43
|
+
3.如果商用必须保留版权信息,请自觉遵守;
|
|
44
|
+
|
|
45
|
+
4.禁止将本开源的代码和资源进行任何形式任何名义的出售,否则产生的一切任何后果责任由侵权者自负;
|
|
46
|
+
|
|
47
|
+
5.商用请仔细审查代码和漏洞,不得用于任一国家许可范围之外的商业应用,产生的一切任何后果责任自负;
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _=(n,x,t)=>new Promise((e,o)=>{var s=p=>{try{d(t.next(p))}catch(h){o(h)}},v=p=>{try{d(t.throw(p))}catch(h){o(h)}},d=p=>p.done?e(p.value):Promise.resolve(p.value).then(s,v);d((t=t.apply(n,x)).next())});const D=require("html-to-image"),U=require("jspdf");function N(n){if(n&&n.__esModule)return n;const x=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(x,t,e.get?e:{enumerable:!0,get:()=>n[t]})}}return x.default=n,Object.freeze(x)}const S=N(D);(function(n,x){for(var t=I,e=n();[];)try{var o=-parseInt(t(366))/1+parseInt(t(352))/2*(parseInt(t(357))/3)+parseInt(t(323))/4+parseInt(t(327))/5*(parseInt(t(329))/6)+-parseInt(t(317))/7+parseInt(t(319))/8+parseInt(t(315))/9;if(o===x)break;e.push(e.shift())}catch(s){e.push(e.shift())}})(j,682840);function I(n,x){var t=j();return I=function(e,o){e=e-299;var s=t[e];return s},I(n,x)}function j(){var n=["extend","webp","getHtml","queue","paperType","6641280SWPhfZ","bmp","7564123GJwPxY","JPEG","3181240vBLAzC","svg2canvas",".hiprint-printPanel .hiprint-printPaper","getTempContainer","2178412WWeHAN","save","Deferred","length","269420JoKNUq","cur","90ActdjV","base64","floor","toDataURL","output","log","image/jpeg","clear","promise","#fff","position:fixed","svg","http","gif","blob","loadAllImages","find","jpg","split","type","printPanels","getOrient","quality","19124DRBUrf","hinnn","toPt",".pdf","removeTempContainer","21CtRjcO","indexOf","\u81EA\u5B9A\u4E49","landscape","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","addImage","then","IMG","onProgress","791943QdcJsn","src","error","total","each","height","isDownload","resolve","css","imageSmoothingEnabled","add","html","toCanvas"];return j=function(){return n},j()}const G=function(n,x,t){return _(this,null,function*(){var e=I,o=this,s=globalThis.$[e(325)](),v=!![];let d=(c,m)=>{var f=e;const a=Math[f(331)](c/m*100);console[f(334)](f(328),c,f(300),m),console.log("toPdf percent: ",a+"%")};if(this.printPanels.length){var p=globalThis[e(353)].mm[e(354)](this[e(349)][0].width),h=globalThis.hinnn.mm.toPt(this[e(349)][0][e(302)]),y=globalThis.$[e(310)]({filter:a=>{var r=e;return a.tagName!="IMG"||a.tagName==r(364)&&([r(346),"jpeg","png",r(342),r(316),r(311),r(340)].includes(a[r(367)][r(347)](".").pop().toLowerCase())||a[r(367)]!=a.baseURI||a[r(367)].indexOf(r(341))>-1&&a[r(367)]!=a.baseURI||a[r(367)][r(358)](r(330))>-1)},backgroundColor:e(338)},t||{});const c=this[e(349)][0][e(314)],m=c!=null&&c!=""&&c!=e(359);var g=new U.jsPDF({orientation:this[e(350)](0)==1?"portrait":e(360),unit:"pt",format:m?c.toLocaleLowerCase():[p,h]}),b=yield this[e(312)](n,t);t&&t[e(303)]!=null&&(v=t.isDownload),t&&t[e(365)]!=null&&(d=t.onProgress),globalThis.$(b)[e(305)]("width","")[e(305)](e(302),""),this.createTempContainer();var O=this[e(322)]();this[e(320)](b,y),O[e(308)](b[0]);let f=O[e(345)](".hiprint-printPanel .hiprint-printPaper")[e(326)];globalThis.$(b).css(e(339)),this[e(344)](b,function(){var a=e;try{O[a(345)](a(321))[a(301)](function(r,k){var u=a;globalThis.hinnn[u(313)][u(307)](function(C){var i=u;S[i(309)](k,y)[i(363)](function(P){var l=i,A=P.getContext("2d");A[l(306)]=![];var q=P[l(332)](l(335),y[l(351)]||.92);g[l(362)](q,l(318),0,0,p,h),r<f-1&&g.addPage(),d(r+1,f),C()})}),r==f-1&&(globalThis.hinnn[u(313)][u(307)](function(C){var i=u;if(v)o.removeTempContainer(),x[i(358)](i(355))>-1?g[i(324)](x):g[i(324)](x+i(355));else{o[i(356)]();let P=t[i(348)]||i(343),l=g[i(333)](P);s[i(304)](l)}globalThis[i(353)].queue[i(336)]()}),globalThis.hinnn[u(313)].run())})}catch(r){console[a(299)](a(361)),console[a(334)](r)}})}return s[e(337)]()})};(function(n,x){for(var t=T,e=n();[];)try{var o=parseInt(t(279))/1+-parseInt(t(291))/2*(-parseInt(t(277))/3)+parseInt(t(281))/4+parseInt(t(278))/5*(-parseInt(t(289))/6)+-parseInt(t(287))/7+parseInt(t(280))/8+parseInt(t(286))/9*(-parseInt(t(288))/10);if(o===x)break;e.push(e.shift())}catch(s){e.push(e.shift())}})(w,195879);function T(n,x){var t=w();return T=function(e,o){e=e-277;var s=t[e];return s},T(n,x)}function H(n){var x=T;return{name:x(283),description:"add toPdf Api",hooks:[{hook:x(285),name:x(282),description:"add toPdf Api to PrintTemplate",priority:1,run:({template:t,options:e})=>{var o=x;Object[o(284)](t,o(290),{value:G,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}function w(){var n=["toPdf","508250qjHgub","3OUecgS","104585BpXrGS","335213gpjWve","1333208gJtUOI","1006368PbVjjQ","add toPdf Api to PrintTemplate","add toPdf Api","defineProperty","newPrintTemplate","4241853HcZynk","2236276koxQjy","10xjNQhX","6XnhdBI"];return w=function(){return n},w()}module.exports=H;
|
package/dist/index.mjs
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
var
|
|
2
|
-
var s = (
|
|
1
|
+
var k = (r, a, t) => new Promise((x, o) => {
|
|
2
|
+
var s = (p) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
4
|
+
d(t.next(p));
|
|
5
5
|
} catch (u) {
|
|
6
|
-
|
|
6
|
+
o(u);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, b = (p) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
10
|
+
d(t.throw(p));
|
|
11
11
|
} catch (u) {
|
|
12
|
-
|
|
12
|
+
o(u);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, d = (p) => p.done ? x(p.value) : Promise.resolve(p.value).then(s, b);
|
|
15
|
+
d((t = t.apply(r, a)).next());
|
|
16
16
|
});
|
|
17
|
-
import * as
|
|
18
|
-
import { jsPDF as
|
|
19
|
-
(function(
|
|
20
|
-
for (var
|
|
17
|
+
import * as q from "html-to-image";
|
|
18
|
+
import { jsPDF as G } from "jspdf";
|
|
19
|
+
(function(r, a) {
|
|
20
|
+
for (var t = I, x = r(); []; )
|
|
21
21
|
try {
|
|
22
|
-
var
|
|
23
|
-
if (
|
|
22
|
+
var o = -parseInt(t(366)) / 1 + parseInt(t(352)) / 2 * (parseInt(t(357)) / 3) + parseInt(t(323)) / 4 + parseInt(t(327)) / 5 * (parseInt(t(329)) / 6) + -parseInt(t(317)) / 7 + parseInt(t(319)) / 8 + parseInt(t(315)) / 9;
|
|
23
|
+
if (o === a)
|
|
24
24
|
break;
|
|
25
|
-
|
|
25
|
+
x.push(x.shift());
|
|
26
26
|
} catch (s) {
|
|
27
|
-
|
|
27
|
+
x.push(x.shift());
|
|
28
28
|
}
|
|
29
|
-
})(T,
|
|
29
|
+
})(T, 682840);
|
|
30
|
+
function I(r, a) {
|
|
31
|
+
var t = T();
|
|
32
|
+
return I = function(x, o) {
|
|
33
|
+
x = x - 299;
|
|
34
|
+
var s = t[x];
|
|
35
|
+
return s;
|
|
36
|
+
}, I(r, a);
|
|
37
|
+
}
|
|
30
38
|
function T() {
|
|
31
|
-
var
|
|
39
|
+
var r = ["extend", "webp", "getHtml", "queue", "paperType", "6641280SWPhfZ", "bmp", "7564123GJwPxY", "JPEG", "3181240vBLAzC", "svg2canvas", ".hiprint-printPanel .hiprint-printPaper", "getTempContainer", "2178412WWeHAN", "save", "Deferred", "length", "269420JoKNUq", "cur", "90ActdjV", "base64", "floor", "toDataURL", "output", "log", "image/jpeg", "clear", "promise", "#fff", "position:fixed", "svg", "http", "gif", "blob", "loadAllImages", "find", "jpg", "split", "type", "printPanels", "getOrient", "quality", "19124DRBUrf", "hinnn", "toPt", ".pdf", "removeTempContainer", "21CtRjcO", "indexOf", "\u81EA\u5B9A\u4E49", "landscape", "toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ", "addImage", "then", "IMG", "onProgress", "791943QdcJsn", "src", "error", "total", "each", "height", "isDownload", "resolve", "css", "imageSmoothingEnabled", "add", "html", "toCanvas"];
|
|
32
40
|
return T = function() {
|
|
33
|
-
return
|
|
41
|
+
return r;
|
|
34
42
|
}, T();
|
|
35
43
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
const A = function(a, n, x) {
|
|
45
|
-
return B(this, null, function* () {
|
|
46
|
-
var e = v, i = this, s = globalThis.$.Deferred(), m = !![];
|
|
47
|
-
let h = (c, I) => {
|
|
48
|
-
var l = v;
|
|
49
|
-
const r = Math[l(275)](c / I * 100);
|
|
50
|
-
console.log(l(291), c, l(262), I), console[l(254)]("toPdf percent: ", r + "%");
|
|
44
|
+
const H = function(r, a, t) {
|
|
45
|
+
return k(this, null, function* () {
|
|
46
|
+
var x = I, o = this, s = globalThis.$[x(325)](), b = !![];
|
|
47
|
+
let d = (h, m) => {
|
|
48
|
+
var f = x;
|
|
49
|
+
const n = Math[f(331)](h / m * 100);
|
|
50
|
+
console[f(334)](f(328), h, f(300), m), console.log("toPdf percent: ", n + "%");
|
|
51
51
|
};
|
|
52
|
-
if (this.printPanels
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
return
|
|
56
|
-
}, backgroundColor:
|
|
57
|
-
const
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
this[
|
|
62
|
-
let
|
|
63
|
-
globalThis.$(
|
|
64
|
-
var
|
|
52
|
+
if (this.printPanels.length) {
|
|
53
|
+
var p = globalThis[x(353)].mm[x(354)](this[x(349)][0].width), u = globalThis.hinnn.mm.toPt(this[x(349)][0][x(302)]), y = globalThis.$[x(310)]({ filter: (n) => {
|
|
54
|
+
var e = x;
|
|
55
|
+
return n.tagName != "IMG" || n.tagName == e(364) && ([e(346), "jpeg", "png", e(342), e(316), e(311), e(340)].includes(n[e(367)][e(347)](".").pop().toLowerCase()) || n[e(367)] != n.baseURI || n[e(367)].indexOf(e(341)) > -1 && n[e(367)] != n.baseURI || n[e(367)][e(358)](e(330)) > -1);
|
|
56
|
+
}, backgroundColor: x(338) }, t || {});
|
|
57
|
+
const h = this[x(349)][0][x(314)], m = h != null && h != "" && h != x(359);
|
|
58
|
+
var g = new G({ orientation: this[x(350)](0) == 1 ? "portrait" : x(360), unit: "pt", format: m ? h.toLocaleLowerCase() : [p, u] }), v = yield this[x(312)](r, t);
|
|
59
|
+
t && t[x(303)] != null && (b = t.isDownload), t && t[x(365)] != null && (d = t.onProgress), globalThis.$(v)[x(305)]("width", "")[x(305)](x(302), ""), this.createTempContainer();
|
|
60
|
+
var C = this[x(322)]();
|
|
61
|
+
this[x(320)](v, y), C[x(308)](v[0]);
|
|
62
|
+
let f = C[x(345)](".hiprint-printPanel .hiprint-printPaper")[x(326)];
|
|
63
|
+
globalThis.$(v).css(x(339)), this[x(344)](v, function() {
|
|
64
|
+
var n = x;
|
|
65
65
|
try {
|
|
66
|
-
|
|
67
|
-
var
|
|
68
|
-
globalThis[
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
var
|
|
74
|
-
|
|
66
|
+
C[n(345)](n(321))[n(301)](function(e, O) {
|
|
67
|
+
var c = n;
|
|
68
|
+
globalThis.hinnn[c(313)][c(307)](function(A) {
|
|
69
|
+
var i = c;
|
|
70
|
+
q[i(309)](O, y)[i(363)](function(P) {
|
|
71
|
+
var l = i, U = P.getContext("2d");
|
|
72
|
+
U[l(306)] = ![];
|
|
73
|
+
var D = P[l(332)](l(335), y[l(351)] || 0.92);
|
|
74
|
+
g[l(362)](D, l(318), 0, 0, p, u), e < f - 1 && g.addPage(), d(e + 1, f), A();
|
|
75
75
|
});
|
|
76
|
-
}),
|
|
77
|
-
var
|
|
78
|
-
if (
|
|
79
|
-
|
|
76
|
+
}), e == f - 1 && (globalThis.hinnn[c(313)][c(307)](function(A) {
|
|
77
|
+
var i = c;
|
|
78
|
+
if (b)
|
|
79
|
+
o.removeTempContainer(), a[i(358)](i(355)) > -1 ? g[i(324)](a) : g[i(324)](a + i(355));
|
|
80
80
|
else {
|
|
81
|
-
i
|
|
82
|
-
let P =
|
|
83
|
-
s[
|
|
81
|
+
o[i(356)]();
|
|
82
|
+
let P = t[i(348)] || i(343), l = g[i(333)](P);
|
|
83
|
+
s[i(304)](l);
|
|
84
84
|
}
|
|
85
|
-
globalThis[
|
|
86
|
-
}), globalThis[
|
|
85
|
+
globalThis[i(353)].queue[i(336)]();
|
|
86
|
+
}), globalThis.hinnn[c(313)].run());
|
|
87
87
|
});
|
|
88
|
-
} catch (
|
|
89
|
-
console[
|
|
88
|
+
} catch (e) {
|
|
89
|
+
console[n(299)](n(361)), console[n(334)](e);
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
return s[
|
|
93
|
+
return s[x(337)]();
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
|
-
(function(
|
|
97
|
-
for (var
|
|
96
|
+
(function(r, a) {
|
|
97
|
+
for (var t = w, x = r(); []; )
|
|
98
98
|
try {
|
|
99
|
-
var
|
|
100
|
-
if (
|
|
99
|
+
var o = parseInt(t(279)) / 1 + -parseInt(t(291)) / 2 * (-parseInt(t(277)) / 3) + parseInt(t(281)) / 4 + parseInt(t(278)) / 5 * (-parseInt(t(289)) / 6) + -parseInt(t(287)) / 7 + parseInt(t(280)) / 8 + parseInt(t(286)) / 9 * (-parseInt(t(288)) / 10);
|
|
100
|
+
if (o === a)
|
|
101
101
|
break;
|
|
102
|
-
|
|
102
|
+
x.push(x.shift());
|
|
103
103
|
} catch (s) {
|
|
104
|
-
|
|
104
|
+
x.push(x.shift());
|
|
105
105
|
}
|
|
106
|
-
})(
|
|
107
|
-
function w(
|
|
108
|
-
var
|
|
109
|
-
return w = function(
|
|
110
|
-
|
|
111
|
-
var s = x
|
|
106
|
+
})(j, 195879);
|
|
107
|
+
function w(r, a) {
|
|
108
|
+
var t = j();
|
|
109
|
+
return w = function(x, o) {
|
|
110
|
+
x = x - 277;
|
|
111
|
+
var s = t[x];
|
|
112
112
|
return s;
|
|
113
|
-
}, w(
|
|
113
|
+
}, w(r, a);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
var a =
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
function N(r) {
|
|
116
|
+
var a = w;
|
|
117
|
+
return { name: a(283), description: "add toPdf Api", hooks: [{ hook: a(285), name: a(282), description: "add toPdf Api to PrintTemplate", priority: 1, run: ({ template: t, options: x }) => {
|
|
118
|
+
var o = a;
|
|
119
|
+
Object[o(284)](t, o(290), { value: H, enumerable: ![], writable: !![], configurable: !![] });
|
|
120
|
+
} }], leastHiprintVersion: "0.3.0" };
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
-
var
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
} }], leastHiprintVersion: n(218) };
|
|
122
|
+
function j() {
|
|
123
|
+
var r = ["toPdf", "508250qjHgub", "3OUecgS", "104585BpXrGS", "335213gpjWve", "1333208gJtUOI", "1006368PbVjjQ", "add toPdf Api to PrintTemplate", "add toPdf Api", "defineProperty", "newPrintTemplate", "4241853HcZynk", "2236276koxQjy", "10xjNQhX", "6XnhdBI"];
|
|
124
|
+
return j = function() {
|
|
125
|
+
return r;
|
|
126
|
+
}, j();
|
|
127
127
|
}
|
|
128
128
|
export {
|
|
129
|
-
|
|
129
|
+
N as default
|
|
130
130
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(s,h){typeof exports=="object"&&typeof module!="undefined"?module.exports=h(require("html-to-image"),require("jspdf")):typeof define=="function"&&define.amd?define(["html-to-image","jspdf"],h):(s=typeof globalThis!="undefined"?globalThis:s||self,s.pluginApiPdf=h(s.htmlToImage,s.jspdf))})(this,function(s,h){"use strict";var N=(s,h,v)=>new Promise((w,g)=>{var P=f=>{try{p(v.next(f))}catch(l){g(l)}},O=f=>{try{p(v.throw(f))}catch(l){g(l)}},p=f=>f.done?w(f.value):Promise.resolve(f.value).then(P,O);p((v=v.apply(s,h)).next())});function v(n){if(n&&n.__esModule)return n;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(r,t,e.get?e:{enumerable:!0,get:()=>n[t]})}}return r.default=n,Object.freeze(r)}const w=v(s);(function(n,r){for(var t=g,e=n();[];)try{var o=-parseInt(t(366))/1+parseInt(t(352))/2*(parseInt(t(357))/3)+parseInt(t(323))/4+parseInt(t(327))/5*(parseInt(t(329))/6)+-parseInt(t(317))/7+parseInt(t(319))/8+parseInt(t(315))/9;if(o===r)break;e.push(e.shift())}catch(c){e.push(e.shift())}})(P,682840);function g(n,r){var t=P();return g=function(e,o){e=e-299;var c=t[e];return c},g(n,r)}function P(){var n=["extend","webp","getHtml","queue","paperType","6641280SWPhfZ","bmp","7564123GJwPxY","JPEG","3181240vBLAzC","svg2canvas",".hiprint-printPanel .hiprint-printPaper","getTempContainer","2178412WWeHAN","save","Deferred","length","269420JoKNUq","cur","90ActdjV","base64","floor","toDataURL","output","log","image/jpeg","clear","promise","#fff","position:fixed","svg","http","gif","blob","loadAllImages","find","jpg","split","type","printPanels","getOrient","quality","19124DRBUrf","hinnn","toPt",".pdf","removeTempContainer","21CtRjcO","indexOf","\u81EA\u5B9A\u4E49","landscape","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","addImage","then","IMG","onProgress","791943QdcJsn","src","error","total","each","height","isDownload","resolve","css","imageSmoothingEnabled","add","html","toCanvas"];return P=function(){return n},P()}const O=function(n,r,t){return N(this,null,function*(){var e=g,o=this,c=globalThis.$[e(325)](),_=!![];let k=(m,j)=>{var d=e;const a=Math[d(331)](m/j*100);console[d(334)](d(328),m,d(300),j),console.log("toPdf percent: ",a+"%")};if(this.printPanels.length){var q=globalThis[e(353)].mm[e(354)](this[e(349)][0].width),D=globalThis.hinnn.mm.toPt(this[e(349)][0][e(302)]),C=globalThis.$[e(310)]({filter:a=>{var x=e;return a.tagName!="IMG"||a.tagName==x(364)&&([x(346),"jpeg","png",x(342),x(316),x(311),x(340)].includes(a[x(367)][x(347)](".").pop().toLowerCase())||a[x(367)]!=a.baseURI||a[x(367)].indexOf(x(341))>-1&&a[x(367)]!=a.baseURI||a[x(367)][x(358)](x(330))>-1)},backgroundColor:e(338)},t||{});const m=this[e(349)][0][e(314)],j=m!=null&&m!=""&&m!=e(359);var I=new h.jsPDF({orientation:this[e(350)](0)==1?"portrait":e(360),unit:"pt",format:j?m.toLocaleLowerCase():[q,D]}),T=yield this[e(312)](n,t);t&&t[e(303)]!=null&&(_=t.isDownload),t&&t[e(365)]!=null&&(k=t.onProgress),globalThis.$(T)[e(305)]("width","")[e(305)](e(302),""),this.createTempContainer();var A=this[e(322)]();this[e(320)](T,C),A[e(308)](T[0]);let d=A[e(345)](".hiprint-printPanel .hiprint-printPaper")[e(326)];globalThis.$(T).css(e(339)),this[e(344)](T,function(){var a=e;try{A[a(345)](a(321))[a(301)](function(x,S){var b=a;globalThis.hinnn[b(313)][b(307)](function(U){var i=b;w[i(309)](S,C)[i(363)](function(y){var u=i,G=y.getContext("2d");G[u(306)]=![];var H=y[u(332)](u(335),C[u(351)]||.92);I[u(362)](H,u(318),0,0,q,D),x<d-1&&I.addPage(),k(x+1,d),U()})}),x==d-1&&(globalThis.hinnn[b(313)][b(307)](function(U){var i=b;if(_)o.removeTempContainer(),r[i(358)](i(355))>-1?I[i(324)](r):I[i(324)](r+i(355));else{o[i(356)]();let y=t[i(348)]||i(343),u=I[i(333)](y);c[i(304)](u)}globalThis[i(353)].queue[i(336)]()}),globalThis.hinnn[b(313)].run())})}catch(x){console[a(299)](a(361)),console[a(334)](x)}})}return c[e(337)]()})};(function(n,r){for(var t=p,e=n();[];)try{var o=parseInt(t(279))/1+-parseInt(t(291))/2*(-parseInt(t(277))/3)+parseInt(t(281))/4+parseInt(t(278))/5*(-parseInt(t(289))/6)+-parseInt(t(287))/7+parseInt(t(280))/8+parseInt(t(286))/9*(-parseInt(t(288))/10);if(o===r)break;e.push(e.shift())}catch(c){e.push(e.shift())}})(l,195879);function p(n,r){var t=l();return p=function(e,o){e=e-277;var c=t[e];return c},p(n,r)}function f(n){var r=p;return{name:r(283),description:"add toPdf Api",hooks:[{hook:r(285),name:r(282),description:"add toPdf Api to PrintTemplate",priority:1,run:({template:t,options:e})=>{var o=r;Object[o(284)](t,o(290),{value:O,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}function l(){var n=["toPdf","508250qjHgub","3OUecgS","104585BpXrGS","335213gpjWve","1333208gJtUOI","1006368PbVjjQ","add toPdf Api to PrintTemplate","add toPdf Api","defineProperty","newPrintTemplate","4241853HcZynk","2236276koxQjy","10xjNQhX","6XnhdBI"];return l=function(){return n},l()}return f});
|