@sv-print/plugin-api-pdf 0.2.0 → 0.2.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/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var L=(n,e,a)=>new Promise((x,p)=>{var l=t=>{try{f(a.next(t))}catch(m){p(m)}},I=t=>{try{f(a.throw(t))}catch(m){p(m)}},f=t=>t.done?x(t.value):Promise.resolve(t.value).then(l,I);f((a=a.apply(n,e)).next())});const J=require("@zumer/snapdom"),Q=require("jspdf");(function(n,e){const a=b,x=n();for(;[];)try{if(parseInt(a(150))/1+parseInt(a(169))/2*(parseInt(a(168))/3)+-parseInt(a(174))/4*(parseInt(a(137))/5)+-parseInt(a(139))/6+parseInt(a(140))/7*(-parseInt(a(172))/8)+parseInt(a(151))/9*(-parseInt(a(178))/10)+parseInt(a(165))/11*(parseInt(a(159))/12)===e)break;x.push(x.shift())}catch(p){x.push(x.shift())}})(M,286433);function b(n,e){const a=M();return b=function(x,p){return x=x-122,a[x]},b(n,e)}const U=function(n,e,a){return L(this,null,function*(){const x=b;var p=this,l=globalThis.$.Deferred(),I=!![];let f=(v,P)=>{const c=b,i=Math.floor(v/P*100);console[c(122)](c(124),v,"total",P),console[c(122)]("toPdf percent: ",i+"%")},t=a||{};if(this[x(191)][x(170)]){if(typeof e=="string"){const d=e[x(180)](x(160))>-1?e:e+x(160);t[x(131)]=d}else t=e||{},!t[x(131)]&&(t[x(131)]=x(194)+Date[x(195)]()+x(160));let v=this.printPanels[0][x(183)],P=this.printPanels[0][x(167)];var m=globalThis[x(152)].mm[x(193)](t[x(198)]||v),k=globalThis[x(152)].mm[x(193)](t[x(147)]||P),u=globalThis.$[x(161)]({},t||{});const c=this.printPanels[0].paperType,i=this[x(191)][0][x(199)],O=i&&(i.layoutRowGap>0||i[x(197)]>0),R=c!=null&&c!=""&&c!=x(202);var w=new Q.jsPDF({orientation:this[x(142)](0)==1?x(126):"landscape",unit:"pt",format:R?c[x(158)]():[m,k]}),g=yield this.getHtml(n,t);t&&(t[x(176)]&&(u[x(134)]=t[x(176)],u[x(133)]=t[x(176)]),t[x(181)]!=null&&(I=t[x(181)]),t[x(179)]!=null&&(f=t[x(179)])),globalThis.$(g)[x(148)](x(183),"").css(x(167),""),this[x(175)]();var C=this[x(156)]();if(O&&t.paperWidth&&t.paperHeight){let d=Math[x(130)](t[x(198)]/(v+i[x(141)]/2)),h=Math[x(130)](t[x(147)]/(P+i[x(197)]/2));const _=d*h,T=g.find(x(189)),y=T[x(170)],r=Math[x(157)](y/_);let o=globalThis.$(x(144));i.layoutType==x(171)?o.append(x(127)+(Number(i[x(141)])||0)/2+x(184)+(Number(i[x(197)])||0)/2+`mm;
1
+ "use strict";var L=(i,e,a)=>new Promise((x,o)=>{var b=t=>{try{m(a.next(t))}catch(u){o(u)}},w=t=>{try{m(a.throw(t))}catch(u){o(u)}},m=t=>t.done?x(t.value):Promise.resolve(t.value).then(b,w);m((a=a.apply(i,e)).next())});const W=require("@zumer/snapdom"),B=require("jspdf");(function(i,e){const a=I,x=i();for(;[];)try{if(parseInt(a(189))/1+-parseInt(a(195))/2+-parseInt(a(151))/3*(parseInt(a(138))/4)+-parseInt(a(143))/5+-parseInt(a(184))/6*(parseInt(a(177))/7)+-parseInt(a(133))/8+-parseInt(a(201))/9*(-parseInt(a(196))/10)===e)break;x.push(x.shift())}catch(o){x.push(x.shift())}})(k,780489);const E=function(i,e,a){return L(this,null,function*(){const x=I;var o=this,b=globalThis.$.Deferred(),w=!![];let m=(_,P)=>{const d=I,r=Math[d(199)](_/P*100);console.log("cur",_,d(192),P),console[d(156)](d(187),r+"%")},t=a||{};if(this[x(171)][x(174)]){if(typeof e===x(172)){const c=e[x(125)](".pdf")>-1?e:e+x(179);t.name=c}else t=e||{},!t[x(182)]&&(t[x(182)]=x(193)+Date[x(131)]()+".pdf");let _=this[x(171)][0][x(141)],P=this[x(171)][0].height;var u=globalThis.hinnn.mm[x(162)](t[x(175)]||_),J=globalThis[x(140)].mm[x(162)](t[x(153)]||P),f=globalThis.$[x(197)]({},t||{});const d=this[x(171)][0][x(128)],r=this[x(171)][0][x(176)],O=r&&(r[x(132)]>0||r[x(129)]>0),R=d!=null&&d!=""&&d!=x(144);var C=new B.jsPDF({orientation:this[x(161)](0)==1?x(136):x(181),unit:"pt",format:R?d.toLocaleLowerCase():[u,J]}),g=yield this[x(164)](i,t);t&&(t.pixelRatio&&(f.dpr=t[x(198)],f.scale=t[x(198)]),t[x(134)]!=null&&(w=t[x(134)]),t[x(148)]!=null&&(m=t[x(148)])),globalThis.$(g)[x(137)](x(141),"")[x(137)](x(183),""),this[x(194)]();var v=this[x(155)]();if(O&&t[x(175)]&&t[x(153)]){let c=Math[x(199)](t.paperWidth/(_+r.layoutRowGap/2)),h=Math.floor(t[x(153)]/(P+r.layoutColumnGap/2));const T=c*h,l=g[x(139)](x(123)),y=l[x(174)],n=Math[x(120)](y/T);let s=globalThis.$(x(146));r[x(186)]==x(173)?s[x(168)](x(135)+(Number(r[x(132)])||0)/2+x(122)+(Number(r.layoutColumnGap)||0)/2+`mm;
2
2
  }
3
3
  .hiprint-printTemplate .hiprint-printPanel-small {
4
4
  display:inline-block;
5
- padding: `+(Number(i[x(141)])||0)/2+x(163)+(Number(i.layoutColumnGap)||0)/2+x(185)):o[x(129)](`<style>
5
+ padding: `+(Number(r[x(132)])||0)/2+"mm "+(Number(r.layoutColumnGap)||0)/2+x(185)):s[x(168)](`<style>
6
6
  .hiprint-printPanel-small{
7
7
  box-sizing: border-box;
8
8
  border: 0px;
@@ -16,16 +16,15 @@
16
16
  flex-wrap: wrap;
17
17
  flex-direction: column;
18
18
  align-content: flex-start;
19
- margin: -`+(Number(i[x(141)])||0)/2+x(184)+(Number(i.layoutColumnGap)||0)/2+`mm;
19
+ margin: -`+(Number(r[x(132)])||0)/2+"mm -"+(Number(r[x(129)])||0)/2+x(204)+(Number(r[x(132)])||0)/2+x(157)+(Number(r.layoutColumnGap)||0)/2+x(185));for(let p=0;p<n;p++){const G=globalThis.$(x(152)+t.paperWidth+x(154)+t[x(153)]+x(118)),$=p*T,U=Math.min((p+1)*T,y);for(let N=$;N<U;N++){const q=l.eq(N)[x(150)]();q[x(127)](x(170)),q[x(158)](x(160)+N);const A=globalThis.$('<div class="hiprint-printPanel-small"></div>');A.append(q),G[x(139)](x(178)).append(A)}s.append(G)}this[x(169)](s,f),v[x(145)](s[0]),globalThis.$(s)[x(137)](x(200))}else this.svg2canvas(g,f),v[x(145)](g[0]),globalThis.$(g)[x(137)](x(200));let M=v[x(139)](x(123))[x(174)];this.loadAllImages(v,function(){const c=x;try{v[c(139)](c(123))[c(165)](function(h,T){const l=c;globalThis[l(140)][l(191)][l(119)](function(y){const n=l;W.snapdom[n(147)](T,f)[n(159)](function(s){const p=n;var G=s[p(180)]("2d");G[p(126)]=![];var $=s[p(142)]("image/jpeg",f.quality||.92);C[p(205)]($,"JPEG",0,0,u,J),h<M-1&&C[p(124)](),m(h+1,M),y()})[n(121)](s=>{const p=n;throw new Error(s[p(206)])})}),h==M-1&&(globalThis[l(140)][l(191)][l(119)](function(y){const n=l;if(w)o[n(202)](),C[n(130)](t[n(182)]);else{o[n(202)]();let s=t[n(167)]||"blob",p=C[n(149)](s);b[n(166)](p)}globalThis.hinnn[n(191)][n(203)]()}),globalThis[l(140)].queue.run())})}catch(h){console[c(163)](c(188)),console[c(156)](h)}})}return b[x(190)]()})};function I(i,e){const a=k();return I=function(x,o){return x=x-118,a[x]},I(i,e)}function k(){const i=["clone","6dMscGT",`<div class="hiprint-printPanel">
20
+ <div class="hiprint-printPaper" style="width:`,"paperHeight","mm;height:","getTempContainer","log","mm ","addClass","then","hiprint-printPaper-small start-","getOrient","toPt","error","getHtml","each","resolve","type","append","svg2canvas","hiprint-printPaper","printPanels","string","row","length","paperWidth","panelLayoutOptions","1023631wWoxaT",".hiprint-printPaper",".pdf","getContext","landscape","name","height","30WptyTU",`mm;
21
+ }
22
+ </style>`,"layoutType","toPdf percent: ","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","1168448GPmBDt","promise","queue","total","sv-print-","createTempContainer","2647114kIxruS","1428210JcRIkc","extend","pixelRatio","floor","position:fixed","261MdYkZK","removeTempContainer","clear",`mm;
20
23
  }
21
24
  .hiprint-printTemplate .hiprint-printPanel-small {
22
25
  display:inline-block;
23
- padding: `+(Number(i.layoutRowGap)||0)/2+x(163)+(Number(i[x(197)])||0)/2+`mm;
24
- }
25
- </style>`);for(let s=0;s<r;s++){const q=globalThis.$(x(143)+t.paperWidth+"mm;height:"+t[x(147)]+x(192)),$=s*_,H=Math.min((s+1)*_,y);for(let G=$;G<H;G++){const D=T.eq(G)[x(136)]();D[x(138)](x(186)),D[x(173)]("hiprint-printPaper-small start-"+G);const z=globalThis.$(x(145));z[x(129)](D),q[x(149)](x(132))[x(129)](z)}o[x(129)](q)}this.svg2canvas(o,u),C[x(200)](o[0]),globalThis.$(o).css(x(164))}else this[x(123)](g,u),C[x(200)](g[0]),globalThis.$(g)[x(148)](x(164));let j=C[x(149)](x(189)).length;this.loadAllImages(g,function(){const d=x;try{C[d(149)](".hiprint-printPanel .hiprint-printPaper").each(function(h,_){const T=d;globalThis.hinnn.queue.add(function(y){const r=b;J.snapdom[r(135)](_,u).then(function(o){const s=r;var q=o[s(153)]("2d");q.imageSmoothingEnabled=![];var $=o[s(162)](s(146),u[s(196)]||.92);w.addImage($,"JPEG",0,0,m,k),h<j-1&&w[s(177)](),f(h+1,j),y()})[r(125)](o=>{const s=r;throw new Error(o[s(190)])})}),h==j-1&&(globalThis.hinnn.queue.add(function(y){const r=b;if(I)p[r(155)](),w[r(166)](t.name);else{p[r(155)]();let o=t[r(128)]||"blob",s=w[r(182)](o);l.resolve(s)}globalThis[r(152)][r(201)][r(188)]()}),globalThis[T(152)][T(201)].run())})}catch(h){console.error(d(154)),console[d(122)](h)}})}return l[x(187)]()})};function M(){const n=["mm -",`mm;
26
- }
27
- </style>`,"hiprint-printPaper","promise","clear",".hiprint-printPanel .hiprint-printPaper","message","printPanels",`mm;"></div>
28
- </div>`,"toPt","sv-print-","now","quality","layoutColumnGap","paperWidth","panelLayoutOptions","html","queue","\u81EA\u5B9A\u4E49","log","svg2canvas","cur","catch","portrait",`<style>
26
+ padding: `,"addImage","message",`mm;"></div>
27
+ </div>`,"add","ceil","catch","mm -",".hiprint-printPanel .hiprint-printPaper","addPage","indexOf","imageSmoothingEnabled","removeClass","paperType","layoutColumnGap","save","now","layoutRowGap","303088jpjeEu","isDownload",`<style>
29
28
  .hiprint-printPanel-small{
30
29
  box-sizing: border-box;
31
30
  border: 0px;
@@ -35,5 +34,4 @@
35
34
  padding: 0;
36
35
  }
37
36
  .hiprint-printTemplate .hiprint-printPaper{
38
- margin: -`,"type","append","floor","name",".hiprint-printPaper","scale","dpr","toCanvas","clone","77065jTGfOx","removeClass","931212VmjolX","3493qiKaXV","layoutRowGap","getOrient",`<div class="hiprint-printPanel">
39
- <div class="hiprint-printPaper" style="width:`,'<div class="hiprint-printTemplate"></div>','<div class="hiprint-printPanel-small"></div>',"image/jpeg","paperHeight","css","find","496410JphQqu","225bzKKfo","hinnn","getContext","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","removeTempContainer","getTempContainer","ceil","toLocaleLowerCase","8150280QDxloM",".pdf","extend","toDataURL","mm ","position:fixed","11KwWWQW","save","height","20217frWypB","106MoILUW","length","row","6224LxddCb","addClass","80Jstxgz","createTempContainer","pixelRatio","addPage","157860aXheQJ","onProgress","indexOf","isDownload","output","width"];return M=function(){return n},M()}(function(n,e){for(var a=W,x=n();[];)try{var p=-parseInt(a(372))/1*(-parseInt(a(378))/2)+-parseInt(a(384))/3*(parseInt(a(382))/4)+-parseInt(a(373))/5*(parseInt(a(385))/6)+parseInt(a(377))/7*(parseInt(a(383))/8)+-parseInt(a(368))/9*(parseInt(a(369))/10)+parseInt(a(374))/11*(parseInt(a(370))/12)+parseInt(a(371))/13;if(p===e)break;x.push(x.shift())}catch(l){x.push(x.shift())}})(N,481406);function N(){var n=["27MOEhSM","2658680YUaTMa","5557548stYncn","16497676NlNbli","11923zUbcJC","37975mfUsZp","11xDpdlH","toPdf","add toPdf Api to PrintTemplate","173243Bcupwv","64wscRfe","newPrintTemplate","defineProperty","add toPdf Api","1557396BomoGG","104eqxYYo","3QWpgdj","606hmxlWr"];return N=function(){return n},N()}function W(n,e){var a=N();return W=function(x,p){x=x-368;var l=a[x];return l},W(n,e)}function A(n){var e=W;return{name:e(381),description:e(381),hooks:[{hook:e(379),name:"add toPdf Api to PrintTemplate",description:e(376),priority:1,run:({template:a,options:x})=>{var p=e;Object[p(380)](a,p(375),{value:U,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}module.exports=A;
37
+ margin: -`,"portrait","css","2985212aXroAw","find","hinnn","width","toDataURL","4722770jKjDwl","\u81EA\u5B9A\u4E49","html",'<div class="hiprint-printTemplate"></div>',"toCanvas","onProgress","output"];return k=function(){return i},k()}(function(i,e){for(var a=D,x=i();[];)try{var o=parseInt(a(285))/1*(-parseInt(a(271))/2)+-parseInt(a(278))/3*(-parseInt(a(274))/4)+parseInt(a(276))/5*(-parseInt(a(270))/6)+-parseInt(a(269))/7*(parseInt(a(281))/8)+parseInt(a(286))/9+-parseInt(a(282))/10+-parseInt(a(279))/11*(-parseInt(a(272))/12);if(o===e)break;x.push(x.shift())}catch(b){x.push(x.shift())}})(j,888198);function j(){var i=["defineProperty","add toPdf Api to PrintTemplate","2723IGOXJN","8021799kZgTqd","101689obIHjr","195666UJaNvt","530sNXPXd","29986056hlVKwJ","0.3.0","2852356gBcZAa","newPrintTemplate","30pJdmwU","toPdf","6DDlCVP","11vOMLVp","add toPdf Api","808UNSBJG","15436410LeGBkC"];return j=function(){return i},j()}function D(i,e){var a=j();return D=function(x,o){x=x-269;var b=a[x];return b},D(i,e)}function H(i){var e=D;return{name:"add toPdf Api",description:e(280),hooks:[{hook:e(275),name:e(284),description:e(284),priority:1,run:({template:a,options:x})=>{var o=e;Object[o(283)](a,o(277),{value:E,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:e(273)}}module.exports=H;
package/dist/index.mjs CHANGED
@@ -1,67 +1,61 @@
1
- var O = (e, n, a) => new Promise((x, p) => {
2
- var l = (t) => {
1
+ var O = (i, e, a) => new Promise((x, o) => {
2
+ var b = (t) => {
3
3
  try {
4
- f(a.next(t));
5
- } catch (m) {
6
- p(m);
4
+ m(a.next(t));
5
+ } catch (u) {
6
+ o(u);
7
7
  }
8
- }, I = (t) => {
8
+ }, w = (t) => {
9
9
  try {
10
- f(a.throw(t));
11
- } catch (m) {
12
- p(m);
10
+ m(a.throw(t));
11
+ } catch (u) {
12
+ o(u);
13
13
  }
14
- }, f = (t) => t.done ? x(t.value) : Promise.resolve(t.value).then(l, I);
15
- f((a = a.apply(e, n)).next());
14
+ }, m = (t) => t.done ? x(t.value) : Promise.resolve(t.value).then(b, w);
15
+ m((a = a.apply(i, e)).next());
16
16
  });
17
- import { snapdom as J } from "@zumer/snapdom";
18
- import { jsPDF as Q } from "jspdf";
19
- (function(e, n) {
20
- const a = b, x = e();
17
+ import { snapdom as W } from "@zumer/snapdom";
18
+ import { jsPDF as B } from "jspdf";
19
+ (function(i, e) {
20
+ const a = I, x = i();
21
21
  for (; []; )
22
22
  try {
23
- if (parseInt(a(150)) / 1 + parseInt(a(169)) / 2 * (parseInt(a(168)) / 3) + -parseInt(a(174)) / 4 * (parseInt(a(137)) / 5) + -parseInt(a(139)) / 6 + parseInt(a(140)) / 7 * (-parseInt(a(172)) / 8) + parseInt(a(151)) / 9 * (-parseInt(a(178)) / 10) + parseInt(a(165)) / 11 * (parseInt(a(159)) / 12) === n)
23
+ if (parseInt(a(189)) / 1 + -parseInt(a(195)) / 2 + -parseInt(a(151)) / 3 * (parseInt(a(138)) / 4) + -parseInt(a(143)) / 5 + -parseInt(a(184)) / 6 * (parseInt(a(177)) / 7) + -parseInt(a(133)) / 8 + -parseInt(a(201)) / 9 * (-parseInt(a(196)) / 10) === e)
24
24
  break;
25
25
  x.push(x.shift());
26
- } catch (p) {
26
+ } catch (o) {
27
27
  x.push(x.shift());
28
28
  }
29
- })(N, 286433);
30
- function b(e, n) {
31
- const a = N();
32
- return b = function(x, p) {
33
- return x = x - 122, a[x];
34
- }, b(e, n);
35
- }
36
- const U = function(e, n, a) {
29
+ })(k, 780489);
30
+ const E = function(i, e, a) {
37
31
  return O(this, null, function* () {
38
- const x = b;
39
- var p = this, l = globalThis.$.Deferred(), I = !![];
40
- let f = (v, P) => {
41
- const c = b, i = Math.floor(v / P * 100);
42
- console[c(122)](c(124), v, "total", P), console[c(122)]("toPdf percent: ", i + "%");
32
+ const x = I;
33
+ var o = this, b = globalThis.$.Deferred(), w = !![];
34
+ let m = (_, P) => {
35
+ const d = I, r = Math[d(199)](_ / P * 100);
36
+ console.log("cur", _, d(192), P), console[d(156)](d(187), r + "%");
43
37
  }, t = a || {};
44
- if (this[x(191)][x(170)]) {
45
- if (typeof n == "string") {
46
- const d = n[x(180)](x(160)) > -1 ? n : n + x(160);
47
- t[x(131)] = d;
38
+ if (this[x(171)][x(174)]) {
39
+ if (typeof e === x(172)) {
40
+ const c = e[x(125)](".pdf") > -1 ? e : e + x(179);
41
+ t.name = c;
48
42
  } else
49
- t = n || {}, !t[x(131)] && (t[x(131)] = x(194) + Date[x(195)]() + x(160));
50
- let v = this.printPanels[0][x(183)], P = this.printPanels[0][x(167)];
51
- var m = globalThis[x(152)].mm[x(193)](t[x(198)] || v), k = globalThis[x(152)].mm[x(193)](t[x(147)] || P), u = globalThis.$[x(161)]({}, t || {});
52
- const c = this.printPanels[0].paperType, i = this[x(191)][0][x(199)], R = i && (i.layoutRowGap > 0 || i[x(197)] > 0), z = c != null && c != "" && c != x(202);
53
- var w = new Q({ orientation: this[x(142)](0) == 1 ? x(126) : "landscape", unit: "pt", format: z ? c[x(158)]() : [m, k] }), g = yield this.getHtml(e, t);
54
- t && (t[x(176)] && (u[x(134)] = t[x(176)], u[x(133)] = t[x(176)]), t[x(181)] != null && (I = t[x(181)]), t[x(179)] != null && (f = t[x(179)])), globalThis.$(g)[x(148)](x(183), "").css(x(167), ""), this[x(175)]();
55
- var C = this[x(156)]();
56
- if (R && t.paperWidth && t.paperHeight) {
57
- let d = Math[x(130)](t[x(198)] / (v + i[x(141)] / 2)), h = Math[x(130)](t[x(147)] / (P + i[x(197)] / 2));
58
- const _ = d * h, T = g.find(x(189)), y = T[x(170)], r = Math[x(157)](y / _);
59
- let s = globalThis.$(x(144));
60
- i.layoutType == x(171) ? s.append(x(127) + (Number(i[x(141)]) || 0) / 2 + x(184) + (Number(i[x(197)]) || 0) / 2 + `mm;
43
+ t = e || {}, !t[x(182)] && (t[x(182)] = x(193) + Date[x(131)]() + ".pdf");
44
+ let _ = this[x(171)][0][x(141)], P = this[x(171)][0].height;
45
+ var u = globalThis.hinnn.mm[x(162)](t[x(175)] || _), A = globalThis[x(140)].mm[x(162)](t[x(153)] || P), f = globalThis.$[x(197)]({}, t || {});
46
+ const d = this[x(171)][0][x(128)], r = this[x(171)][0][x(176)], R = r && (r[x(132)] > 0 || r[x(129)] > 0), q = d != null && d != "" && d != x(144);
47
+ var C = new B({ orientation: this[x(161)](0) == 1 ? x(136) : x(181), unit: "pt", format: q ? d.toLocaleLowerCase() : [u, A] }), g = yield this[x(164)](i, t);
48
+ t && (t.pixelRatio && (f.dpr = t[x(198)], f.scale = t[x(198)]), t[x(134)] != null && (w = t[x(134)]), t[x(148)] != null && (m = t[x(148)])), globalThis.$(g)[x(137)](x(141), "")[x(137)](x(183), ""), this[x(194)]();
49
+ var v = this[x(155)]();
50
+ if (R && t[x(175)] && t[x(153)]) {
51
+ let c = Math[x(199)](t.paperWidth / (_ + r.layoutRowGap / 2)), h = Math.floor(t[x(153)] / (P + r.layoutColumnGap / 2));
52
+ const T = c * h, l = g[x(139)](x(123)), y = l[x(174)], n = Math[x(120)](y / T);
53
+ let s = globalThis.$(x(146));
54
+ r[x(186)] == x(173) ? s[x(168)](x(135) + (Number(r[x(132)]) || 0) / 2 + x(122) + (Number(r.layoutColumnGap) || 0) / 2 + `mm;
61
55
  }
62
56
  .hiprint-printTemplate .hiprint-printPanel-small {
63
57
  display:inline-block;
64
- padding: ` + (Number(i[x(141)]) || 0) / 2 + x(163) + (Number(i.layoutColumnGap) || 0) / 2 + x(185)) : s[x(129)](`<style>
58
+ padding: ` + (Number(r[x(132)]) || 0) / 2 + "mm " + (Number(r.layoutColumnGap) || 0) / 2 + x(185)) : s[x(168)](`<style>
65
59
  .hiprint-printPanel-small{
66
60
  box-sizing: border-box;
67
61
  border: 0px;
@@ -75,69 +69,74 @@ const U = function(e, n, a) {
75
69
  flex-wrap: wrap;
76
70
  flex-direction: column;
77
71
  align-content: flex-start;
78
- margin: -` + (Number(i[x(141)]) || 0) / 2 + x(184) + (Number(i.layoutColumnGap) || 0) / 2 + `mm;
79
- }
80
- .hiprint-printTemplate .hiprint-printPanel-small {
81
- display:inline-block;
82
- padding: ` + (Number(i.layoutRowGap) || 0) / 2 + x(163) + (Number(i[x(197)]) || 0) / 2 + `mm;
83
- }
84
- </style>`);
85
- for (let o = 0; o < r; o++) {
86
- const G = globalThis.$(x(143) + t.paperWidth + "mm;height:" + t[x(147)] + x(192)), D = o * _, H = Math.min((o + 1) * _, y);
87
- for (let M = D; M < H; M++) {
88
- const j = T.eq(M)[x(136)]();
89
- j[x(138)](x(186)), j[x(173)]("hiprint-printPaper-small start-" + M);
90
- const L = globalThis.$(x(145));
91
- L[x(129)](j), G[x(149)](x(132))[x(129)](L);
72
+ margin: -` + (Number(r[x(132)]) || 0) / 2 + "mm -" + (Number(r[x(129)]) || 0) / 2 + x(204) + (Number(r[x(132)]) || 0) / 2 + x(157) + (Number(r.layoutColumnGap) || 0) / 2 + x(185));
73
+ for (let p = 0; p < n; p++) {
74
+ const G = globalThis.$(x(152) + t.paperWidth + x(154) + t[x(153)] + x(118)), $ = p * T, U = Math.min((p + 1) * T, y);
75
+ for (let N = $; N < U; N++) {
76
+ const J = l.eq(N)[x(150)]();
77
+ J[x(127)](x(170)), J[x(158)](x(160) + N);
78
+ const L = globalThis.$('<div class="hiprint-printPanel-small"></div>');
79
+ L.append(J), G[x(139)](x(178)).append(L);
92
80
  }
93
- s[x(129)](G);
81
+ s.append(G);
94
82
  }
95
- this.svg2canvas(s, u), C[x(200)](s[0]), globalThis.$(s).css(x(164));
83
+ this[x(169)](s, f), v[x(145)](s[0]), globalThis.$(s)[x(137)](x(200));
96
84
  } else
97
- this[x(123)](g, u), C[x(200)](g[0]), globalThis.$(g)[x(148)](x(164));
98
- let $ = C[x(149)](x(189)).length;
99
- this.loadAllImages(g, function() {
100
- const d = x;
85
+ this.svg2canvas(g, f), v[x(145)](g[0]), globalThis.$(g)[x(137)](x(200));
86
+ let M = v[x(139)](x(123))[x(174)];
87
+ this.loadAllImages(v, function() {
88
+ const c = x;
101
89
  try {
102
- C[d(149)](".hiprint-printPanel .hiprint-printPaper").each(function(h, _) {
103
- const T = d;
104
- globalThis.hinnn.queue.add(function(y) {
105
- const r = b;
106
- J[r(135)](_, u).then(function(s) {
107
- const o = r;
108
- var G = s[o(153)]("2d");
109
- G.imageSmoothingEnabled = ![];
110
- var D = s[o(162)](o(146), u[o(196)] || 0.92);
111
- w.addImage(D, "JPEG", 0, 0, m, k), h < $ - 1 && w[o(177)](), f(h + 1, $), y();
112
- })[r(125)]((s) => {
113
- const o = r;
114
- throw new Error(s[o(190)]);
90
+ v[c(139)](c(123))[c(165)](function(h, T) {
91
+ const l = c;
92
+ globalThis[l(140)][l(191)][l(119)](function(y) {
93
+ const n = l;
94
+ W[n(147)](T, f)[n(159)](function(s) {
95
+ const p = n;
96
+ var G = s[p(180)]("2d");
97
+ G[p(126)] = ![];
98
+ var $ = s[p(142)]("image/jpeg", f.quality || 0.92);
99
+ C[p(205)]($, "JPEG", 0, 0, u, A), h < M - 1 && C[p(124)](), m(h + 1, M), y();
100
+ })[n(121)]((s) => {
101
+ const p = n;
102
+ throw new Error(s[p(206)]);
115
103
  });
116
- }), h == $ - 1 && (globalThis.hinnn.queue.add(function(y) {
117
- const r = b;
118
- if (I)
119
- p[r(155)](), w[r(166)](t.name);
104
+ }), h == M - 1 && (globalThis[l(140)][l(191)][l(119)](function(y) {
105
+ const n = l;
106
+ if (w)
107
+ o[n(202)](), C[n(130)](t[n(182)]);
120
108
  else {
121
- p[r(155)]();
122
- let s = t[r(128)] || "blob", o = w[r(182)](s);
123
- l.resolve(o);
109
+ o[n(202)]();
110
+ let s = t[n(167)] || "blob", p = C[n(149)](s);
111
+ b[n(166)](p);
124
112
  }
125
- globalThis[r(152)][r(201)][r(188)]();
126
- }), globalThis[T(152)][T(201)].run());
113
+ globalThis.hinnn[n(191)][n(203)]();
114
+ }), globalThis[l(140)].queue.run());
127
115
  });
128
116
  } catch (h) {
129
- console.error(d(154)), console[d(122)](h);
117
+ console[c(163)](c(188)), console[c(156)](h);
130
118
  }
131
119
  });
132
120
  }
133
- return l[x(187)]();
121
+ return b[x(190)]();
134
122
  });
135
123
  };
136
- function N() {
137
- const e = ["mm -", `mm;
124
+ function I(i, e) {
125
+ const a = k();
126
+ return I = function(x, o) {
127
+ return x = x - 118, a[x];
128
+ }, I(i, e);
129
+ }
130
+ function k() {
131
+ const i = ["clone", "6dMscGT", `<div class="hiprint-printPanel">
132
+ <div class="hiprint-printPaper" style="width:`, "paperHeight", "mm;height:", "getTempContainer", "log", "mm ", "addClass", "then", "hiprint-printPaper-small start-", "getOrient", "toPt", "error", "getHtml", "each", "resolve", "type", "append", "svg2canvas", "hiprint-printPaper", "printPanels", "string", "row", "length", "paperWidth", "panelLayoutOptions", "1023631wWoxaT", ".hiprint-printPaper", ".pdf", "getContext", "landscape", "name", "height", "30WptyTU", `mm;
133
+ }
134
+ </style>`, "layoutType", "toPdf percent: ", "toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ", "1168448GPmBDt", "promise", "queue", "total", "sv-print-", "createTempContainer", "2647114kIxruS", "1428210JcRIkc", "extend", "pixelRatio", "floor", "position:fixed", "261MdYkZK", "removeTempContainer", "clear", `mm;
138
135
  }
139
- </style>`, "hiprint-printPaper", "promise", "clear", ".hiprint-printPanel .hiprint-printPaper", "message", "printPanels", `mm;"></div>
140
- </div>`, "toPt", "sv-print-", "now", "quality", "layoutColumnGap", "paperWidth", "panelLayoutOptions", "html", "queue", "\u81EA\u5B9A\u4E49", "log", "svg2canvas", "cur", "catch", "portrait", `<style>
136
+ .hiprint-printTemplate .hiprint-printPanel-small {
137
+ display:inline-block;
138
+ padding: `, "addImage", "message", `mm;"></div>
139
+ </div>`, "add", "ceil", "catch", "mm -", ".hiprint-printPanel .hiprint-printPaper", "addPage", "indexOf", "imageSmoothingEnabled", "removeClass", "paperType", "layoutColumnGap", "save", "now", "layoutRowGap", "303088jpjeEu", "isDownload", `<style>
141
140
  .hiprint-printPanel-small{
142
141
  box-sizing: border-box;
143
142
  border: 0px;
@@ -147,44 +146,43 @@ function N() {
147
146
  padding: 0;
148
147
  }
149
148
  .hiprint-printTemplate .hiprint-printPaper{
150
- margin: -`, "type", "append", "floor", "name", ".hiprint-printPaper", "scale", "dpr", "toCanvas", "clone", "77065jTGfOx", "removeClass", "931212VmjolX", "3493qiKaXV", "layoutRowGap", "getOrient", `<div class="hiprint-printPanel">
151
- <div class="hiprint-printPaper" style="width:`, '<div class="hiprint-printTemplate"></div>', '<div class="hiprint-printPanel-small"></div>', "image/jpeg", "paperHeight", "css", "find", "496410JphQqu", "225bzKKfo", "hinnn", "getContext", "toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ", "removeTempContainer", "getTempContainer", "ceil", "toLocaleLowerCase", "8150280QDxloM", ".pdf", "extend", "toDataURL", "mm ", "position:fixed", "11KwWWQW", "save", "height", "20217frWypB", "106MoILUW", "length", "row", "6224LxddCb", "addClass", "80Jstxgz", "createTempContainer", "pixelRatio", "addPage", "157860aXheQJ", "onProgress", "indexOf", "isDownload", "output", "width"];
152
- return N = function() {
153
- return e;
154
- }, N();
149
+ margin: -`, "portrait", "css", "2985212aXroAw", "find", "hinnn", "width", "toDataURL", "4722770jKjDwl", "\u81EA\u5B9A\u4E49", "html", '<div class="hiprint-printTemplate"></div>', "toCanvas", "onProgress", "output"];
150
+ return k = function() {
151
+ return i;
152
+ }, k();
155
153
  }
156
- (function(e, n) {
157
- for (var a = q, x = e(); []; )
154
+ (function(i, e) {
155
+ for (var a = j, x = i(); []; )
158
156
  try {
159
- var p = -parseInt(a(372)) / 1 * (-parseInt(a(378)) / 2) + -parseInt(a(384)) / 3 * (parseInt(a(382)) / 4) + -parseInt(a(373)) / 5 * (parseInt(a(385)) / 6) + parseInt(a(377)) / 7 * (parseInt(a(383)) / 8) + -parseInt(a(368)) / 9 * (parseInt(a(369)) / 10) + parseInt(a(374)) / 11 * (parseInt(a(370)) / 12) + parseInt(a(371)) / 13;
160
- if (p === n)
157
+ var o = parseInt(a(285)) / 1 * (-parseInt(a(271)) / 2) + -parseInt(a(278)) / 3 * (-parseInt(a(274)) / 4) + parseInt(a(276)) / 5 * (-parseInt(a(270)) / 6) + -parseInt(a(269)) / 7 * (parseInt(a(281)) / 8) + parseInt(a(286)) / 9 + -parseInt(a(282)) / 10 + -parseInt(a(279)) / 11 * (-parseInt(a(272)) / 12);
158
+ if (o === e)
161
159
  break;
162
160
  x.push(x.shift());
163
- } catch (l) {
161
+ } catch (b) {
164
162
  x.push(x.shift());
165
163
  }
166
- })(W, 481406);
167
- function W() {
168
- var e = ["27MOEhSM", "2658680YUaTMa", "5557548stYncn", "16497676NlNbli", "11923zUbcJC", "37975mfUsZp", "11xDpdlH", "toPdf", "add toPdf Api to PrintTemplate", "173243Bcupwv", "64wscRfe", "newPrintTemplate", "defineProperty", "add toPdf Api", "1557396BomoGG", "104eqxYYo", "3QWpgdj", "606hmxlWr"];
169
- return W = function() {
170
- return e;
171
- }, W();
164
+ })(D, 888198);
165
+ function D() {
166
+ var i = ["defineProperty", "add toPdf Api to PrintTemplate", "2723IGOXJN", "8021799kZgTqd", "101689obIHjr", "195666UJaNvt", "530sNXPXd", "29986056hlVKwJ", "0.3.0", "2852356gBcZAa", "newPrintTemplate", "30pJdmwU", "toPdf", "6DDlCVP", "11vOMLVp", "add toPdf Api", "808UNSBJG", "15436410LeGBkC"];
167
+ return D = function() {
168
+ return i;
169
+ }, D();
172
170
  }
173
- function q(e, n) {
174
- var a = W();
175
- return q = function(x, p) {
176
- x = x - 368;
177
- var l = a[x];
178
- return l;
179
- }, q(e, n);
171
+ function j(i, e) {
172
+ var a = D();
173
+ return j = function(x, o) {
174
+ x = x - 269;
175
+ var b = a[x];
176
+ return b;
177
+ }, j(i, e);
180
178
  }
181
- function Y(e) {
182
- var n = q;
183
- return { name: n(381), description: n(381), hooks: [{ hook: n(379), name: "add toPdf Api to PrintTemplate", description: n(376), priority: 1, run: ({ template: a, options: x }) => {
184
- var p = n;
185
- Object[p(380)](a, p(375), { value: U, enumerable: ![], writable: !![], configurable: !![] });
186
- } }], leastHiprintVersion: "0.3.0" };
179
+ function K(i) {
180
+ var e = j;
181
+ return { name: "add toPdf Api", description: e(280), hooks: [{ hook: e(275), name: e(284), description: e(284), priority: 1, run: ({ template: a, options: x }) => {
182
+ var o = e;
183
+ Object[o(283)](a, o(277), { value: E, enumerable: ![], writable: !![], configurable: !![] });
184
+ } }], leastHiprintVersion: e(273) };
187
185
  }
188
186
  export {
189
- Y as default
187
+ K as default
190
188
  };
package/dist/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(d,f){typeof exports=="object"&&typeof module!="undefined"?module.exports=f(require("@zumer/snapdom"),require("jspdf")):typeof define=="function"&&define.amd?define(["@zumer/snapdom","jspdf"],f):(d=typeof globalThis!="undefined"?globalThis:d||self,d.pluginApiPdf=f(d.snapdom,d.jspdf))})(this,function(d,f){"use strict";var H=(d,f,o)=>new Promise((W,b)=>{var u=n=>{try{T(o.next(n))}catch(e){b(e)}},g=n=>{try{T(o.throw(n))}catch(e){b(e)}},T=n=>n.done?W(n.value):Promise.resolve(n.value).then(u,g);T((o=o.apply(d,f)).next())});(function(n,e){const t=o,x=n();for(;[];)try{if(parseInt(t(150))/1+parseInt(t(169))/2*(parseInt(t(168))/3)+-parseInt(t(174))/4*(parseInt(t(137))/5)+-parseInt(t(139))/6+parseInt(t(140))/7*(-parseInt(t(172))/8)+parseInt(t(151))/9*(-parseInt(t(178))/10)+parseInt(t(165))/11*(parseInt(t(159))/12)===e)break;x.push(x.shift())}catch(l){x.push(x.shift())}})(b,286433);function o(n,e){const t=b();return o=function(x,l){return x=x-122,t[x]},o(n,e)}const W=function(n,e,t){return H(this,null,function*(){const x=o;var l=this,P=globalThis.$.Deferred(),k=!![];let L=(y,I)=>{const c=o,i=Math.floor(y/I*100);console[c(122)](c(124),y,"total",I),console[c(122)]("toPdf percent: ",i+"%")},a=t||{};if(this[x(191)][x(170)]){if(typeof e=="string"){const h=e[x(180)](x(160))>-1?e:e+x(160);a[x(131)]=h}else a=e||{},!a[x(131)]&&(a[x(131)]=x(194)+Date[x(195)]()+x(160));let y=this.printPanels[0][x(183)],I=this.printPanels[0][x(167)];var O=globalThis[x(152)].mm[x(193)](a[x(198)]||y),R=globalThis[x(152)].mm[x(193)](a[x(147)]||I),v=globalThis.$[x(161)]({},a||{});const c=this.printPanels[0].paperType,i=this[x(191)][0][x(199)],J=i&&(i.layoutRowGap>0||i[x(197)]>0),Q=c!=null&&c!=""&&c!=x(202);var q=new f.jsPDF({orientation:this[x(142)](0)==1?x(126):"landscape",unit:"pt",format:Q?c[x(158)]():[O,R]}),_=yield this.getHtml(n,a);a&&(a[x(176)]&&(v[x(134)]=a[x(176)],v[x(133)]=a[x(176)]),a[x(181)]!=null&&(k=a[x(181)]),a[x(179)]!=null&&(L=a[x(179)])),globalThis.$(_)[x(148)](x(183),"").css(x(167),""),this[x(175)]();var G=this[x(156)]();if(J&&a.paperWidth&&a.paperHeight){let h=Math[x(130)](a[x(198)]/(y+i[x(141)]/2)),m=Math[x(130)](a[x(147)]/(I+i[x(197)]/2));const w=h*m,C=_.find(x(189)),j=C[x(170)],r=Math[x(157)](j/w);let s=globalThis.$(x(144));i.layoutType==x(171)?s.append(x(127)+(Number(i[x(141)])||0)/2+x(184)+(Number(i[x(197)])||0)/2+`mm;
1
+ (function(d,h){typeof exports=="object"&&typeof module!="undefined"?module.exports=h(require("@zumer/snapdom"),require("jspdf")):typeof define=="function"&&define.amd?define(["@zumer/snapdom","jspdf"],h):(d=typeof globalThis!="undefined"?globalThis:d||self,d.pluginApiPdf=h(d.window,d.jspdf))})(this,function(d,h){"use strict";var W=(d,h,g)=>new Promise((m,u)=>{var v=n=>{try{y(g.next(n))}catch(e){u(e)}},P=n=>{try{y(g.throw(n))}catch(e){u(e)}},y=n=>n.done?m(n.value):Promise.resolve(n.value).then(v,P);y((g=g.apply(d,h)).next())});(function(n,e){const a=m,x=n();for(;[];)try{if(parseInt(a(189))/1+-parseInt(a(195))/2+-parseInt(a(151))/3*(parseInt(a(138))/4)+-parseInt(a(143))/5+-parseInt(a(184))/6*(parseInt(a(177))/7)+-parseInt(a(133))/8+-parseInt(a(201))/9*(-parseInt(a(196))/10)===e)break;x.push(x.shift())}catch(l){x.push(x.shift())}})(u,780489);const g=function(n,e,a){return W(this,null,function*(){const x=m;var l=this,_=globalThis.$.Deferred(),J=!![];let L=(C,G)=>{const b=m,r=Math[b(199)](C/G*100);console.log("cur",C,b(192),G),console[b(156)](b(187),r+"%")},t=a||{};if(this[x(171)][x(174)]){if(typeof e===x(172)){const c=e[x(125)](".pdf")>-1?e:e+x(179);t.name=c}else t=e||{},!t[x(182)]&&(t[x(182)]=x(193)+Date[x(131)]()+".pdf");let C=this[x(171)][0][x(141)],G=this[x(171)][0].height;var O=globalThis.hinnn.mm[x(162)](t[x(175)]||C),R=globalThis[x(140)].mm[x(162)](t[x(153)]||G),T=globalThis.$[x(197)]({},t||{});const b=this[x(171)][0][x(128)],r=this[x(171)][0][x(176)],z=r&&(r[x(132)]>0||r[x(129)]>0),B=b!=null&&b!=""&&b!=x(144);var k=new h.jsPDF({orientation:this[x(161)](0)==1?x(136):x(181),unit:"pt",format:B?b.toLocaleLowerCase():[O,R]}),I=yield this[x(164)](n,t);t&&(t.pixelRatio&&(T.dpr=t[x(198)],T.scale=t[x(198)]),t[x(134)]!=null&&(J=t[x(134)]),t[x(148)]!=null&&(L=t[x(148)])),globalThis.$(I)[x(137)](x(141),"")[x(137)](x(183),""),this[x(194)]();var w=this[x(155)]();if(z&&t[x(175)]&&t[x(153)]){let c=Math[x(199)](t.paperWidth/(C+r.layoutRowGap/2)),f=Math.floor(t[x(153)]/(G+r.layoutColumnGap/2));const j=c*f,s=I[x(139)](x(123)),N=s[x(174)],i=Math[x(120)](N/j);let p=globalThis.$(x(146));r[x(186)]==x(173)?p[x(168)](x(135)+(Number(r[x(132)])||0)/2+x(122)+(Number(r.layoutColumnGap)||0)/2+`mm;
2
2
  }
3
3
  .hiprint-printTemplate .hiprint-printPanel-small {
4
4
  display:inline-block;
5
- padding: `+(Number(i[x(141)])||0)/2+x(163)+(Number(i.layoutColumnGap)||0)/2+x(185)):s[x(129)](`<style>
5
+ padding: `+(Number(r[x(132)])||0)/2+"mm "+(Number(r.layoutColumnGap)||0)/2+x(185)):p[x(168)](`<style>
6
6
  .hiprint-printPanel-small{
7
7
  box-sizing: border-box;
8
8
  border: 0px;
@@ -16,16 +16,15 @@
16
16
  flex-wrap: wrap;
17
17
  flex-direction: column;
18
18
  align-content: flex-start;
19
- margin: -`+(Number(i[x(141)])||0)/2+x(184)+(Number(i.layoutColumnGap)||0)/2+`mm;
19
+ margin: -`+(Number(r[x(132)])||0)/2+"mm -"+(Number(r[x(129)])||0)/2+x(204)+(Number(r[x(132)])||0)/2+x(157)+(Number(r.layoutColumnGap)||0)/2+x(185));for(let o=0;o<i;o++){const D=globalThis.$(x(152)+t.paperWidth+x(154)+t[x(153)]+x(118)),q=o*j,E=Math.min((o+1)*j,N);for(let M=q;M<E;M++){const A=s.eq(M)[x(150)]();A[x(127)](x(170)),A[x(158)](x(160)+M);const U=globalThis.$('<div class="hiprint-printPanel-small"></div>');U.append(A),D[x(139)](x(178)).append(U)}p.append(D)}this[x(169)](p,T),w[x(145)](p[0]),globalThis.$(p)[x(137)](x(200))}else this.svg2canvas(I,T),w[x(145)](I[0]),globalThis.$(I)[x(137)](x(200));let $=w[x(139)](x(123))[x(174)];this.loadAllImages(w,function(){const c=x;try{w[c(139)](c(123))[c(165)](function(f,j){const s=c;globalThis[s(140)][s(191)][s(119)](function(N){const i=s;d.snapdom[i(147)](j,T)[i(159)](function(p){const o=i;var D=p[o(180)]("2d");D[o(126)]=![];var q=p[o(142)]("image/jpeg",T.quality||.92);k[o(205)](q,"JPEG",0,0,O,R),f<$-1&&k[o(124)](),L(f+1,$),N()})[i(121)](p=>{const o=i;throw new Error(p[o(206)])})}),f==$-1&&(globalThis[s(140)][s(191)][s(119)](function(N){const i=s;if(J)l[i(202)](),k[i(130)](t[i(182)]);else{l[i(202)]();let p=t[i(167)]||"blob",o=k[i(149)](p);_[i(166)](o)}globalThis.hinnn[i(191)][i(203)]()}),globalThis[s(140)].queue.run())})}catch(f){console[c(163)](c(188)),console[c(156)](f)}})}return _[x(190)]()})};function m(n,e){const a=u();return m=function(x,l){return x=x-118,a[x]},m(n,e)}function u(){const n=["clone","6dMscGT",`<div class="hiprint-printPanel">
20
+ <div class="hiprint-printPaper" style="width:`,"paperHeight","mm;height:","getTempContainer","log","mm ","addClass","then","hiprint-printPaper-small start-","getOrient","toPt","error","getHtml","each","resolve","type","append","svg2canvas","hiprint-printPaper","printPanels","string","row","length","paperWidth","panelLayoutOptions","1023631wWoxaT",".hiprint-printPaper",".pdf","getContext","landscape","name","height","30WptyTU",`mm;
21
+ }
22
+ </style>`,"layoutType","toPdf percent: ","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","1168448GPmBDt","promise","queue","total","sv-print-","createTempContainer","2647114kIxruS","1428210JcRIkc","extend","pixelRatio","floor","position:fixed","261MdYkZK","removeTempContainer","clear",`mm;
20
23
  }
21
24
  .hiprint-printTemplate .hiprint-printPanel-small {
22
25
  display:inline-block;
23
- padding: `+(Number(i.layoutRowGap)||0)/2+x(163)+(Number(i[x(197)])||0)/2+`mm;
24
- }
25
- </style>`);for(let p=0;p<r;p++){const M=globalThis.$(x(143)+a.paperWidth+"mm;height:"+a[x(147)]+x(192)),z=p*w,U=Math.min((p+1)*w,j);for(let N=z;N<U;N++){const D=C.eq(N)[x(136)]();D[x(138)](x(186)),D[x(173)]("hiprint-printPaper-small start-"+N);const A=globalThis.$(x(145));A[x(129)](D),M[x(149)](x(132))[x(129)](A)}s[x(129)](M)}this.svg2canvas(s,v),G[x(200)](s[0]),globalThis.$(s).css(x(164))}else this[x(123)](_,v),G[x(200)](_[0]),globalThis.$(_)[x(148)](x(164));let $=G[x(149)](x(189)).length;this.loadAllImages(_,function(){const h=x;try{G[h(149)](".hiprint-printPanel .hiprint-printPaper").each(function(m,w){const C=h;globalThis.hinnn.queue.add(function(j){const r=o;d.snapdom[r(135)](w,v).then(function(s){const p=r;var M=s[p(153)]("2d");M.imageSmoothingEnabled=![];var z=s[p(162)](p(146),v[p(196)]||.92);q.addImage(z,"JPEG",0,0,O,R),m<$-1&&q[p(177)](),L(m+1,$),j()})[r(125)](s=>{const p=r;throw new Error(s[p(190)])})}),m==$-1&&(globalThis.hinnn.queue.add(function(j){const r=o;if(k)l[r(155)](),q[r(166)](a.name);else{l[r(155)]();let s=a[r(128)]||"blob",p=q[r(182)](s);P.resolve(p)}globalThis[r(152)][r(201)][r(188)]()}),globalThis[C(152)][C(201)].run())})}catch(m){console.error(h(154)),console[h(122)](m)}})}return P[x(187)]()})};function b(){const n=["mm -",`mm;
26
- }
27
- </style>`,"hiprint-printPaper","promise","clear",".hiprint-printPanel .hiprint-printPaper","message","printPanels",`mm;"></div>
28
- </div>`,"toPt","sv-print-","now","quality","layoutColumnGap","paperWidth","panelLayoutOptions","html","queue","\u81EA\u5B9A\u4E49","log","svg2canvas","cur","catch","portrait",`<style>
26
+ padding: `,"addImage","message",`mm;"></div>
27
+ </div>`,"add","ceil","catch","mm -",".hiprint-printPanel .hiprint-printPaper","addPage","indexOf","imageSmoothingEnabled","removeClass","paperType","layoutColumnGap","save","now","layoutRowGap","303088jpjeEu","isDownload",`<style>
29
28
  .hiprint-printPanel-small{
30
29
  box-sizing: border-box;
31
30
  border: 0px;
@@ -35,5 +34,4 @@
35
34
  padding: 0;
36
35
  }
37
36
  .hiprint-printTemplate .hiprint-printPaper{
38
- margin: -`,"type","append","floor","name",".hiprint-printPaper","scale","dpr","toCanvas","clone","77065jTGfOx","removeClass","931212VmjolX","3493qiKaXV","layoutRowGap","getOrient",`<div class="hiprint-printPanel">
39
- <div class="hiprint-printPaper" style="width:`,'<div class="hiprint-printTemplate"></div>','<div class="hiprint-printPanel-small"></div>',"image/jpeg","paperHeight","css","find","496410JphQqu","225bzKKfo","hinnn","getContext","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","removeTempContainer","getTempContainer","ceil","toLocaleLowerCase","8150280QDxloM",".pdf","extend","toDataURL","mm ","position:fixed","11KwWWQW","save","height","20217frWypB","106MoILUW","length","row","6224LxddCb","addClass","80Jstxgz","createTempContainer","pixelRatio","addPage","157860aXheQJ","onProgress","indexOf","isDownload","output","width"];return b=function(){return n},b()}(function(n,e){for(var t=g,x=n();[];)try{var l=-parseInt(t(372))/1*(-parseInt(t(378))/2)+-parseInt(t(384))/3*(parseInt(t(382))/4)+-parseInt(t(373))/5*(parseInt(t(385))/6)+parseInt(t(377))/7*(parseInt(t(383))/8)+-parseInt(t(368))/9*(parseInt(t(369))/10)+parseInt(t(374))/11*(parseInt(t(370))/12)+parseInt(t(371))/13;if(l===e)break;x.push(x.shift())}catch(P){x.push(x.shift())}})(u,481406);function u(){var n=["27MOEhSM","2658680YUaTMa","5557548stYncn","16497676NlNbli","11923zUbcJC","37975mfUsZp","11xDpdlH","toPdf","add toPdf Api to PrintTemplate","173243Bcupwv","64wscRfe","newPrintTemplate","defineProperty","add toPdf Api","1557396BomoGG","104eqxYYo","3QWpgdj","606hmxlWr"];return u=function(){return n},u()}function g(n,e){var t=u();return g=function(x,l){x=x-368;var P=t[x];return P},g(n,e)}function T(n){var e=g;return{name:e(381),description:e(381),hooks:[{hook:e(379),name:"add toPdf Api to PrintTemplate",description:e(376),priority:1,run:({template:t,options:x})=>{var l=e;Object[l(380)](t,l(375),{value:W,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}return T});
37
+ margin: -`,"portrait","css","2985212aXroAw","find","hinnn","width","toDataURL","4722770jKjDwl","\u81EA\u5B9A\u4E49","html",'<div class="hiprint-printTemplate"></div>',"toCanvas","onProgress","output"];return u=function(){return n},u()}(function(n,e){for(var a=P,x=n();[];)try{var l=parseInt(a(285))/1*(-parseInt(a(271))/2)+-parseInt(a(278))/3*(-parseInt(a(274))/4)+parseInt(a(276))/5*(-parseInt(a(270))/6)+-parseInt(a(269))/7*(parseInt(a(281))/8)+parseInt(a(286))/9+-parseInt(a(282))/10+-parseInt(a(279))/11*(-parseInt(a(272))/12);if(l===e)break;x.push(x.shift())}catch(_){x.push(x.shift())}})(v,888198);function v(){var n=["defineProperty","add toPdf Api to PrintTemplate","2723IGOXJN","8021799kZgTqd","101689obIHjr","195666UJaNvt","530sNXPXd","29986056hlVKwJ","0.3.0","2852356gBcZAa","newPrintTemplate","30pJdmwU","toPdf","6DDlCVP","11vOMLVp","add toPdf Api","808UNSBJG","15436410LeGBkC"];return v=function(){return n},v()}function P(n,e){var a=v();return P=function(x,l){x=x-269;var _=a[x];return _},P(n,e)}function y(n){var e=P;return{name:"add toPdf Api",description:e(280),hooks:[{hook:e(275),name:e(284),description:e(284),priority:1,run:({template:a,options:x})=>{var l=e;Object[l(283)](a,l(277),{value:g,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:e(273)}}return y});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sv-print/plugin-api-pdf",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "add pdf api to print template",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",