@sv-print/plugin-api-pdf 0.1.1 → 0.1.2

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 +1,33 @@
1
- "use strict";var _=(x,n,t)=>new Promise((e,i)=>{var s=f=>{try{u(t.next(f))}catch(d){i(d)}},m=f=>{try{u(t.throw(f))}catch(d){i(d)}},u=f=>f.done?e(f.value):Promise.resolve(f.value).then(s,m);u((t=t.apply(x,n)).next())});const L=require("html-to-image"),M=require("jspdf");function S(x){if(x&&x.__esModule)return x;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(x){for(const t in x)if(t!=="default"){const e=Object.getOwnPropertyDescriptor(x,t);Object.defineProperty(n,t,e.get?e:{enumerable:!0,get:()=>x[t]})}}return n.default=x,Object.freeze(n)}const A=S(L);(function(x,n){for(var t=P,e=x();[];)try{var i=-parseInt(t(219))/1*(-parseInt(t(220))/2)+-parseInt(t(243))/3+-parseInt(t(227))/4+parseInt(t(279))/5*(-parseInt(t(242))/6)+parseInt(t(239))/7*(parseInt(t(266))/8)+-parseInt(t(285))/9+parseInt(t(229))/10;if(i===n)break;e.push(e.shift())}catch(s){e.push(e.shift())}})(T,176031);function P(x,n){var t=T();return P=function(e,i){e=e-218;var s=t[e];return s},P(x,n)}const F=function(x,n,t){return _(this,null,function*(){var e=P,i=this,s=globalThis.$[e(244)](),m=!![];let u=(l,v)=>{var b=e;const a=Math.floor(l/v*100);console.log(b(218),l,b(264),v),console[b(263)]("toPdf percent: ",a+"%")};if(this[e(286)][e(231)]){var f=globalThis[e(269)].mm[e(253)](this[e(286)][0][e(270)]),d=globalThis[e(269)].mm[e(253)](this.printPanels[0][e(223)]),j=globalThis.$.extend({filter:a=>{var r=e;return a.tagName!=r(287)||a.tagName=="IMG"&&([r(222),r(280),r(258),"gif",r(241),r(256),r(230)][r(254)](a.src[r(281)](".")[r(248)]()[r(224)]())||a.src!=a[r(271)]||a.src.indexOf("http")>-1&&a[r(255)]!=a[r(271)]||a[r(255)][r(226)](r(247))>-1)},backgroundColor:e(228)},t||{});const l=this.printPanels[0][e(261)],v=l!=null&&l!=""&&l!=e(221);var h=new M.jsPDF({orientation:this[e(234)](0)==1?"portrait":e(233),unit:"pt",format:v?l[e(262)]():[f,d]}),g=yield this[e(273)](x,t);t&&t[e(277)]!=null&&(m=t.isDownload),t&&t.onProgress!=null&&(u=t.onProgress),globalThis.$(g)[e(265)](e(270),"")[e(265)](e(223),""),this[e(284)]();var C=this[e(267)]();this[e(283)](g,j),C[e(236)](g[0]);let b=C[e(276)](e(272)).length;globalThis.$(g)[e(265)](e(240)),this[e(235)](g,function(){var a=e;try{C[a(276)](".hiprint-printPanel .hiprint-printPaper")[a(237)](function(r,q){var p=a;globalThis[p(269)][p(249)][p(252)](function(O){var o=p;A.toCanvas(q,j)[o(278)](function(I){var c=o,D=I[c(238)]("2d");D[c(274)]=![];var k=I.toDataURL(c(251),j[c(245)]||.92);h[c(232)](k,c(259),0,0,f,d),r<b-1&&h.addPage(),u(r+1,b),O()})}),r==b-1&&(globalThis[p(269)].queue[p(252)](function(O){var o=p;if(m)i.removeTempContainer(),n[o(226)](o(257))>-1?h.save(n):h.save(n+o(257));else{i.removeTempContainer();let I=t[o(282)]||o(246),c=h[o(268)](I);s[o(250)](c)}globalThis[o(269)][o(249)][o(288)]()}),globalThis[p(269)][p(249)][p(225)]())})}catch(r){console[a(275)]("toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "),console.log(r)}})}return s[e(260)]()})};function T(){var x=["126tSCgXA","525129zjKAbq","Deferred","quality","blob","base64","pop","queue","resolve","image/jpeg","add","toPt","includes","src","webp",".pdf","png","JPEG","promise","paperType","toLocaleLowerCase","log","total","css","8896yVUbSh","getTempContainer","output","hinnn","width","baseURI",".hiprint-printPanel .hiprint-printPaper","getHtml","imageSmoothingEnabled","error","find","isDownload","then","48295IFKXEc","jpeg","split","type","svg2canvas","createTempContainer","2474244rLXIHk","printPanels","IMG","clear","cur","28321uPIPma","10pcUdri","\u81EA\u5B9A\u4E49","jpg","height","toLowerCase","run","indexOf","616092WBemXG","#fff","5165430qCcCya","svg","length","addImage","landscape","getOrient","loadAllImages","html","each","getContext","2044bDOmYT","position:fixed","bmp"];return T=function(){return x},T()}(function(x,n){for(var t=y,e=x();[];)try{var i=-parseInt(t(437))/1*(-parseInt(t(438))/2)+parseInt(t(442))/3*(parseInt(t(432))/4)+-parseInt(t(439))/5*(-parseInt(t(436))/6)+-parseInt(t(447))/7+-parseInt(t(434))/8+parseInt(t(433))/9+-parseInt(t(446))/10*(-parseInt(t(441))/11);if(i===n)break;e.push(e.shift())}catch(s){e.push(e.shift())}})(w,620196);function y(x,n){var t=w();return y=function(e,i){e=e-432;var s=t[e];return s},y(x,n)}function z(x){var n=y;return{name:n(444),description:n(444),hooks:[{hook:n(443),name:n(440),description:n(440),priority:1,run:({template:t,options:e})=>{var i=n;Object[i(435)](t,i(445),{value:F,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}function w(){var x=["7908523goyyri","17076opfbYs","987075HDZSFT","2837552bcFiTM","defineProperty","79998JfzewA","1zNsKFV","485556bmEBze","110MFLttU","add toPdf Api to PrintTemplate","3817cLRxoS","489aaaqip","newPrintTemplate","add toPdf Api","toPdf","21990nvmIEy"];return w=function(){return x},w()}module.exports=z;
1
+ "use strict";var R=(n,i,e)=>new Promise((x,p)=>{var b=t=>{try{h(e.next(t))}catch(u){p(u)}},w=t=>{try{h(e.throw(t))}catch(u){p(u)}},h=t=>t.done?x(t.value):Promise.resolve(t.value).then(b,w);h((e=e.apply(n,i)).next())});const A=require("html-to-image"),V=require("jspdf");function U(n){if(n&&n.__esModule)return n;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const x=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(i,e,x.get?x:{enumerable:!0,get:()=>n[e]})}}return i.default=n,Object.freeze(i)}const W=U(A);(function(n,i){const e=T,x=n();for(;[];)try{if(parseInt(e(440))/1+parseInt(e(503))/2+parseInt(e(458))/3+parseInt(e(421))/4*(-parseInt(e(472))/5)+-parseInt(e(445))/6+-parseInt(e(488))/7*(parseInt(e(416))/8)+parseInt(e(467))/9===i)break;x.push(x.shift())}catch(p){x.push(x.shift())}})(O,707552);function T(n,i){const e=O();return T=function(x,p){return x=x-415,e[x]},T(n,i)}const B=function(n,i,e){return R(this,null,function*(){const x=T;var p=this,b=globalThis.$.Deferred(),w=!![];let h=(g,P)=>{const f=T,s=Math[f(444)](g/P*100);console[f(453)](f(477),g,f(463),P),console[f(453)](f(451),s+"%")},t=e||{};if(this[x(494)][x(475)]){if(typeof i=="string"){const r=i[x(464)](".pdf")>-1?i:i+x(452);t[x(419)]=r}else t=i||{},!t[x(419)]&&(t.name=x(497)+Date[x(473)]()+x(452));let g=this[x(494)][0][x(493)],P=this[x(494)][0].height;var u=globalThis[x(460)].mm.toPt(t[x(417)]||g),D=globalThis[x(460)].mm[x(449)](t[x(491)]||P),y=globalThis.$[x(489)]({filter:r=>{const a=x;return r[a(434)]!="IMG"||r.tagName=="IMG"&&([a(430),a(448),a(426),"gif",a(465),a(485),a(422)].includes(r[a(481)][a(418)](".")[a(433)]()[a(415)]())||r[a(481)]!=r[a(428)]||r[a(481)][a(464)](a(446))>-1&&r[a(481)]!=r[a(428)]||r.src.indexOf("base64")>-1)},backgroundColor:x(457)},t||{});const f=this.printPanels[0][x(427)],s=this.printPanels[0].panelLayoutOptions,$=s&&(s[x(484)]>0||s[x(483)]>0),z=f!=null&&f!=""&&f!="\u81EA\u5B9A\u4E49";var I=new V.jsPDF({orientation:this[x(486)](0)==1?x(482):x(455),unit:"pt",format:z?f[x(478)]():[u,D]}),m=yield this[x(439)](n,t);t&&t[x(507)]!=null&&(w=t[x(507)]),t&&t[x(462)]!=null&&(h=t[x(462)]),globalThis.$(m)[x(469)]("width","").css(x(459),""),this[x(425)]();var C=this.getTempContainer();if($&&t[x(417)]&&t[x(491)]){let r=Math[x(444)](t[x(417)]/(g+s[x(484)]/2)),a=Math[x(444)](t[x(491)]/(P+s[x(483)]/2));const v=r*a,l=m[x(435)](x(499)),_=l[x(475)],o=Math[x(474)](_/v);let c=globalThis.$(x(431));s[x(438)]=="row"?c[x(447)](x(429)+(Number(s[x(484)])||0)/2+x(468)+(Number(s[x(483)])||0)/2+x(432)+(Number(s.layoutRowGap)||0)/2+x(437)+(Number(s.layoutColumnGap)||0)/2+x(504)):c[x(447)](`<style>
2
+ .hiprint-printPanel-small{
3
+ box-sizing: border-box;
4
+ border: 0px;
5
+ }
6
+ .hiprint-printPaper-small{
7
+ position: relative;
8
+ padding: 0;
9
+ }
10
+ .hiprint-printTemplate .hiprint-printPaper{
11
+ display: flex;
12
+ flex-wrap: wrap;
13
+ flex-direction: column;
14
+ align-content: flex-start;
15
+ margin: -`+(Number(s[x(484)])||0)/2+x(468)+(Number(s[x(483)])||0)/2+x(432)+(Number(s[x(484)])||0)/2+x(437)+(Number(s[x(483)])||0)/2+x(504));for(let d=0;d<o;d++){const j=globalThis.$(`<div class="hiprint-printPanel">
16
+ <div class="hiprint-printPaper" style="width:`+t.paperWidth+x(420)+t[x(491)]+`mm;"></div>
17
+ </div>`),L=d*v,S=Math[x(487)]((d+1)*v,_);for(let N=L;N<S;N++){const k=l.eq(N)[x(505)]();k.removeClass(x(461)),k[x(506)](x(502)+N);const H=globalThis.$('<div class="hiprint-printPanel-small"></div>');H[x(447)](k),j[x(435)](x(443))[x(447)](H)}c[x(447)](j)}this[x(501)](c,y),C[x(466)](c[0]),globalThis.$(c)[x(469)](x(442))}else this[x(501)](m,y),C[x(466)](m[0]),globalThis.$(m)[x(469)](x(442));let G=C.find(".hiprint-printPanel .hiprint-printPaper")[x(475)];this.loadAllImages(m,function(){const r=x;try{C[r(435)](r(499))[r(495)](function(a,v){const l=r;globalThis[l(460)][l(436)][l(498)](function(_){const o=l;W[o(454)](v,y)[o(479)](function(c){const d=o;var j=c[d(496)]("2d");j[d(500)]=![];var L=c[d(423)](d(480),y.quality||.92);I.addImage(L,"JPEG",0,0,u,D),a<G-1&&I.addPage(),h(a+1,G),_()})[o(471)](c=>{const d=o;throw new Error(c[d(456)])})}),a==G-1&&(globalThis[l(460)][l(436)][l(498)](function(_){const o=l;if(w)p[o(470)](),I[o(476)](t[o(419)]);else{p[o(470)]();let c=t[o(441)]||o(490),d=I[o(450)](c);b.resolve(d)}globalThis[o(460)][o(436)].clear()}),globalThis[l(460)].queue[l(424)]())})}catch(a){console[r(492)]("toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "),console[r(453)](a)}})}return b.promise()})};function O(){const n=["message","#fff","4208619DTbSZP","height","hinnn","hiprint-printPaper","onProgress","total","indexOf","bmp","html","5310000eweoHW","mm -","css","removeTempContainer","catch","65gLxMHl","now","ceil","length","save","cur","toLocaleLowerCase","then","image/jpeg","src","portrait","layoutColumnGap","layoutRowGap","webp","getOrient","min","32221ozycqv","extend","blob","paperHeight","error","width","printPanels","each","getContext","sv-print-","add",".hiprint-printPanel .hiprint-printPaper","imageSmoothingEnabled","svg2canvas","hiprint-printPaper-small start-","263716JLHqhL",`mm;
18
+ }
19
+ </style>`,"clone","addClass","isDownload","toLowerCase","1064OQuVRs","paperWidth","split","name","mm;height:","252012TUBfqm","svg","toDataURL","run","createTempContainer","png","paperType","baseURI",`<style>
20
+ .hiprint-printPanel-small{
21
+ box-sizing: border-box;
22
+ border: 0px;
23
+ }
24
+ .hiprint-printPaper-small{
25
+ position: relative;
26
+ padding: 0;
27
+ }
28
+ .hiprint-printTemplate .hiprint-printPaper{
29
+ margin: -`,"jpg",'<div class="hiprint-printTemplate"></div>',`mm;
30
+ }
31
+ .hiprint-printTemplate .hiprint-printPanel-small {
32
+ display:inline-block;
33
+ padding: `,"pop","tagName","find","queue","mm ","layoutType","getHtml","403090NSIRHY","type","position:fixed",".hiprint-printPaper","floor","2334186Csqjzd","http","append","jpeg","toPt","output","toPdf percent: ",".pdf","log","toCanvas","landscape"];return O=function(){return n},O()}(function(n,i){for(var e=q,x=n();[];)try{var p=parseInt(e(186))/1*(parseInt(e(181))/2)+parseInt(e(177))/3+parseInt(e(180))/4*(-parseInt(e(184))/5)+-parseInt(e(183))/6*(parseInt(e(187))/7)+-parseInt(e(176))/8*(-parseInt(e(174))/9)+-parseInt(e(182))/10+parseInt(e(179))/11;if(p===i)break;x.push(x.shift())}catch(b){x.push(x.shift())}})(M,137645);function q(n,i){var e=M();return q=function(x,p){x=x-172;var b=e[x];return b},q(n,i)}function M(){var n=["30969oTwVoo","add toPdf Api","8wHhBkC","559548rBzwwo","toPdf","3110712lnIVuv","4DFfgVw","82OKQCWw","89540jzfgLR","512610MGUCRx","1023220TKZNhr","defineProperty","1204Tvmeyj","14qGSnNa","newPrintTemplate","add toPdf Api to PrintTemplate","0.3.0"];return M=function(){return n},M()}function E(n){var i=q;return{name:"add toPdf Api",description:i(175),hooks:[{hook:i(188),name:"add toPdf Api to PrintTemplate",description:i(172),priority:1,run:({template:e,options:x})=>{var p=i;Object[p(185)](e,p(178),{value:B,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:i(173)}}module.exports=E;
package/dist/index.mjs CHANGED
@@ -1,130 +1,187 @@
1
- var j = (r, n, x) => new Promise((e, i) => {
2
- var s = (f) => {
1
+ var D = (o, n, e) => new Promise((x, p) => {
2
+ var b = (t) => {
3
3
  try {
4
- h(x.next(f));
5
- } catch (u) {
6
- i(u);
4
+ h(e.next(t));
5
+ } catch (m) {
6
+ p(m);
7
7
  }
8
- }, v = (f) => {
8
+ }, w = (t) => {
9
9
  try {
10
- h(x.throw(f));
11
- } catch (u) {
12
- i(u);
10
+ h(e.throw(t));
11
+ } catch (m) {
12
+ p(m);
13
13
  }
14
- }, h = (f) => f.done ? e(f.value) : Promise.resolve(f.value).then(s, v);
15
- h((x = x.apply(r, n)).next());
14
+ }, h = (t) => t.done ? x(t.value) : Promise.resolve(t.value).then(b, w);
15
+ h((e = e.apply(o, n)).next());
16
16
  });
17
- import * as F from "html-to-image";
18
- import { jsPDF as E } from "jspdf";
19
- (function(r, n) {
20
- for (var x = P, e = r(); []; )
17
+ import * as V from "html-to-image";
18
+ import { jsPDF as S } from "jspdf";
19
+ (function(o, n) {
20
+ const e = T, x = o();
21
+ for (; []; )
21
22
  try {
22
- var i = -parseInt(x(219)) / 1 * (-parseInt(x(220)) / 2) + -parseInt(x(243)) / 3 + -parseInt(x(227)) / 4 + parseInt(x(279)) / 5 * (-parseInt(x(242)) / 6) + parseInt(x(239)) / 7 * (parseInt(x(266)) / 8) + -parseInt(x(285)) / 9 + parseInt(x(229)) / 10;
23
- if (i === n)
23
+ if (parseInt(e(440)) / 1 + parseInt(e(503)) / 2 + parseInt(e(458)) / 3 + parseInt(e(421)) / 4 * (-parseInt(e(472)) / 5) + -parseInt(e(445)) / 6 + -parseInt(e(488)) / 7 * (parseInt(e(416)) / 8) + parseInt(e(467)) / 9 === n)
24
24
  break;
25
- e.push(e.shift());
26
- } catch (s) {
27
- e.push(e.shift());
25
+ x.push(x.shift());
26
+ } catch (p) {
27
+ x.push(x.shift());
28
28
  }
29
- })(T, 176031);
30
- function P(r, n) {
31
- var x = T();
32
- return P = function(e, i) {
33
- e = e - 218;
34
- var s = x[e];
35
- return s;
36
- }, P(r, n);
29
+ })(G, 707552);
30
+ function T(o, n) {
31
+ const e = G();
32
+ return T = function(x, p) {
33
+ return x = x - 415, e[x];
34
+ }, T(o, n);
37
35
  }
38
- const M = function(r, n, x) {
39
- return j(this, null, function* () {
40
- var e = P, i = this, s = globalThis.$[e(244)](), v = !![];
41
- let h = (c, m) => {
42
- var b = e;
43
- const a = Math.floor(c / m * 100);
44
- console.log(b(218), c, b(264), m), console[b(263)]("toPdf percent: ", a + "%");
45
- };
46
- if (this[e(286)][e(231)]) {
47
- var f = globalThis[e(269)].mm[e(253)](this[e(286)][0][e(270)]), u = globalThis[e(269)].mm[e(253)](this.printPanels[0][e(223)]), C = globalThis.$.extend({ filter: (a) => {
48
- var t = e;
49
- return a.tagName != t(287) || a.tagName == "IMG" && ([t(222), t(280), t(258), "gif", t(241), t(256), t(230)][t(254)](a.src[t(281)](".")[t(248)]()[t(224)]()) || a.src != a[t(271)] || a.src.indexOf("http") > -1 && a[t(255)] != a[t(271)] || a[t(255)][t(226)](t(247)) > -1);
50
- }, backgroundColor: e(228) }, x || {});
51
- const c = this.printPanels[0][e(261)], m = c != null && c != "" && c != e(221);
52
- var d = new E({ orientation: this[e(234)](0) == 1 ? "portrait" : e(233), unit: "pt", format: m ? c[e(262)]() : [f, u] }), g = yield this[e(273)](r, x);
53
- x && x[e(277)] != null && (v = x.isDownload), x && x.onProgress != null && (h = x.onProgress), globalThis.$(g)[e(265)](e(270), "")[e(265)](e(223), ""), this[e(284)]();
54
- var D = this[e(267)]();
55
- this[e(283)](g, C), D[e(236)](g[0]);
56
- let b = D[e(276)](e(272)).length;
57
- globalThis.$(g)[e(265)](e(240)), this[e(235)](g, function() {
58
- var a = e;
36
+ const U = function(o, n, e) {
37
+ return D(this, null, function* () {
38
+ const x = T;
39
+ var p = this, b = globalThis.$.Deferred(), w = !![];
40
+ let h = (g, v) => {
41
+ const f = T, s = Math[f(444)](g / v * 100);
42
+ console[f(453)](f(477), g, f(463), v), console[f(453)](f(451), s + "%");
43
+ }, t = e || {};
44
+ if (this[x(494)][x(475)]) {
45
+ if (typeof n == "string") {
46
+ const i = n[x(464)](".pdf") > -1 ? n : n + x(452);
47
+ t[x(419)] = i;
48
+ } else
49
+ t = n || {}, !t[x(419)] && (t.name = x(497) + Date[x(473)]() + x(452));
50
+ let g = this[x(494)][0][x(493)], v = this[x(494)][0].height;
51
+ var m = globalThis[x(460)].mm.toPt(t[x(417)] || g), $ = globalThis[x(460)].mm[x(449)](t[x(491)] || v), I = globalThis.$[x(489)]({ filter: (i) => {
52
+ const a = x;
53
+ return i[a(434)] != "IMG" || i.tagName == "IMG" && ([a(430), a(448), a(426), "gif", a(465), a(485), a(422)].includes(i[a(481)][a(418)](".")[a(433)]()[a(415)]()) || i[a(481)] != i[a(428)] || i[a(481)][a(464)](a(446)) > -1 && i[a(481)] != i[a(428)] || i.src.indexOf("base64") > -1);
54
+ }, backgroundColor: x(457) }, t || {});
55
+ const f = this.printPanels[0][x(427)], s = this.printPanels[0].panelLayoutOptions, O = s && (s[x(484)] > 0 || s[x(483)] > 0), z = f != null && f != "" && f != "\u81EA\u5B9A\u4E49";
56
+ var y = new S({ orientation: this[x(486)](0) == 1 ? x(482) : x(455), unit: "pt", format: z ? f[x(478)]() : [m, $] }), u = yield this[x(439)](o, t);
57
+ t && t[x(507)] != null && (w = t[x(507)]), t && t[x(462)] != null && (h = t[x(462)]), globalThis.$(u)[x(469)]("width", "").css(x(459), ""), this[x(425)]();
58
+ var C = this.getTempContainer();
59
+ if (O && t[x(417)] && t[x(491)]) {
60
+ let i = Math[x(444)](t[x(417)] / (g + s[x(484)] / 2)), a = Math[x(444)](t[x(491)] / (v + s[x(483)] / 2));
61
+ const P = i * a, l = u[x(435)](x(499)), _ = l[x(475)], r = Math[x(474)](_ / P);
62
+ let c = globalThis.$(x(431));
63
+ s[x(438)] == "row" ? c[x(447)](x(429) + (Number(s[x(484)]) || 0) / 2 + x(468) + (Number(s[x(483)]) || 0) / 2 + x(432) + (Number(s.layoutRowGap) || 0) / 2 + x(437) + (Number(s.layoutColumnGap) || 0) / 2 + x(504)) : c[x(447)](`<style>
64
+ .hiprint-printPanel-small{
65
+ box-sizing: border-box;
66
+ border: 0px;
67
+ }
68
+ .hiprint-printPaper-small{
69
+ position: relative;
70
+ padding: 0;
71
+ }
72
+ .hiprint-printTemplate .hiprint-printPaper{
73
+ display: flex;
74
+ flex-wrap: wrap;
75
+ flex-direction: column;
76
+ align-content: flex-start;
77
+ margin: -` + (Number(s[x(484)]) || 0) / 2 + x(468) + (Number(s[x(483)]) || 0) / 2 + x(432) + (Number(s[x(484)]) || 0) / 2 + x(437) + (Number(s[x(483)]) || 0) / 2 + x(504));
78
+ for (let d = 0; d < r; d++) {
79
+ const N = globalThis.$(`<div class="hiprint-printPanel">
80
+ <div class="hiprint-printPaper" style="width:` + t.paperWidth + x(420) + t[x(491)] + `mm;"></div>
81
+ </div>`), H = d * P, A = Math[x(487)]((d + 1) * P, _);
82
+ for (let q = H; q < A; q++) {
83
+ const R = l.eq(q)[x(505)]();
84
+ R.removeClass(x(461)), R[x(506)](x(502) + q);
85
+ const k = globalThis.$('<div class="hiprint-printPanel-small"></div>');
86
+ k[x(447)](R), N[x(435)](x(443))[x(447)](k);
87
+ }
88
+ c[x(447)](N);
89
+ }
90
+ this[x(501)](c, I), C[x(466)](c[0]), globalThis.$(c)[x(469)](x(442));
91
+ } else
92
+ this[x(501)](u, I), C[x(466)](u[0]), globalThis.$(u)[x(469)](x(442));
93
+ let j = C.find(".hiprint-printPanel .hiprint-printPaper")[x(475)];
94
+ this.loadAllImages(u, function() {
95
+ const i = x;
59
96
  try {
60
- D[a(276)](".hiprint-printPanel .hiprint-printPaper")[a(237)](function(t, k) {
61
- var p = a;
62
- globalThis[p(269)][p(249)][p(252)](function(L) {
63
- var o = p;
64
- F.toCanvas(k, C)[o(278)](function(I) {
65
- var l = o, q = I[l(238)]("2d");
66
- q[l(274)] = ![];
67
- var A = I.toDataURL(l(251), C[l(245)] || 0.92);
68
- d[l(232)](A, l(259), 0, 0, f, u), t < b - 1 && d.addPage(), h(t + 1, b), L();
97
+ C[i(435)](i(499))[i(495)](function(a, P) {
98
+ const l = i;
99
+ globalThis[l(460)][l(436)][l(498)](function(_) {
100
+ const r = l;
101
+ V[r(454)](P, I)[r(479)](function(c) {
102
+ const d = r;
103
+ var N = c[d(496)]("2d");
104
+ N[d(500)] = ![];
105
+ var H = c[d(423)](d(480), I.quality || 0.92);
106
+ y.addImage(H, "JPEG", 0, 0, m, $), a < j - 1 && y.addPage(), h(a + 1, j), _();
107
+ })[r(471)]((c) => {
108
+ const d = r;
109
+ throw new Error(c[d(456)]);
69
110
  });
70
- }), t == b - 1 && (globalThis[p(269)].queue[p(252)](function(L) {
71
- var o = p;
72
- if (v)
73
- i.removeTempContainer(), n[o(226)](o(257)) > -1 ? d.save(n) : d.save(n + o(257));
111
+ }), a == j - 1 && (globalThis[l(460)][l(436)][l(498)](function(_) {
112
+ const r = l;
113
+ if (w)
114
+ p[r(470)](), y[r(476)](t[r(419)]);
74
115
  else {
75
- i.removeTempContainer();
76
- let I = x[o(282)] || o(246), l = d[o(268)](I);
77
- s[o(250)](l);
116
+ p[r(470)]();
117
+ let c = t[r(441)] || r(490), d = y[r(450)](c);
118
+ b.resolve(d);
78
119
  }
79
- globalThis[o(269)][o(249)][o(288)]();
80
- }), globalThis[p(269)][p(249)][p(225)]());
120
+ globalThis[r(460)][r(436)].clear();
121
+ }), globalThis[l(460)].queue[l(424)]());
81
122
  });
82
- } catch (t) {
83
- console[a(275)]("toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "), console.log(t);
123
+ } catch (a) {
124
+ console[i(492)]("toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "), console[i(453)](a);
84
125
  }
85
126
  });
86
127
  }
87
- return s[e(260)]();
128
+ return b.promise();
88
129
  });
89
130
  };
90
- function T() {
91
- var r = ["126tSCgXA", "525129zjKAbq", "Deferred", "quality", "blob", "base64", "pop", "queue", "resolve", "image/jpeg", "add", "toPt", "includes", "src", "webp", ".pdf", "png", "JPEG", "promise", "paperType", "toLocaleLowerCase", "log", "total", "css", "8896yVUbSh", "getTempContainer", "output", "hinnn", "width", "baseURI", ".hiprint-printPanel .hiprint-printPaper", "getHtml", "imageSmoothingEnabled", "error", "find", "isDownload", "then", "48295IFKXEc", "jpeg", "split", "type", "svg2canvas", "createTempContainer", "2474244rLXIHk", "printPanels", "IMG", "clear", "cur", "28321uPIPma", "10pcUdri", "\u81EA\u5B9A\u4E49", "jpg", "height", "toLowerCase", "run", "indexOf", "616092WBemXG", "#fff", "5165430qCcCya", "svg", "length", "addImage", "landscape", "getOrient", "loadAllImages", "html", "each", "getContext", "2044bDOmYT", "position:fixed", "bmp"];
92
- return T = function() {
93
- return r;
94
- }, T();
131
+ function G() {
132
+ const o = ["message", "#fff", "4208619DTbSZP", "height", "hinnn", "hiprint-printPaper", "onProgress", "total", "indexOf", "bmp", "html", "5310000eweoHW", "mm -", "css", "removeTempContainer", "catch", "65gLxMHl", "now", "ceil", "length", "save", "cur", "toLocaleLowerCase", "then", "image/jpeg", "src", "portrait", "layoutColumnGap", "layoutRowGap", "webp", "getOrient", "min", "32221ozycqv", "extend", "blob", "paperHeight", "error", "width", "printPanels", "each", "getContext", "sv-print-", "add", ".hiprint-printPanel .hiprint-printPaper", "imageSmoothingEnabled", "svg2canvas", "hiprint-printPaper-small start-", "263716JLHqhL", `mm;
133
+ }
134
+ </style>`, "clone", "addClass", "isDownload", "toLowerCase", "1064OQuVRs", "paperWidth", "split", "name", "mm;height:", "252012TUBfqm", "svg", "toDataURL", "run", "createTempContainer", "png", "paperType", "baseURI", `<style>
135
+ .hiprint-printPanel-small{
136
+ box-sizing: border-box;
137
+ border: 0px;
138
+ }
139
+ .hiprint-printPaper-small{
140
+ position: relative;
141
+ padding: 0;
142
+ }
143
+ .hiprint-printTemplate .hiprint-printPaper{
144
+ margin: -`, "jpg", '<div class="hiprint-printTemplate"></div>', `mm;
145
+ }
146
+ .hiprint-printTemplate .hiprint-printPanel-small {
147
+ display:inline-block;
148
+ padding: `, "pop", "tagName", "find", "queue", "mm ", "layoutType", "getHtml", "403090NSIRHY", "type", "position:fixed", ".hiprint-printPaper", "floor", "2334186Csqjzd", "http", "append", "jpeg", "toPt", "output", "toPdf percent: ", ".pdf", "log", "toCanvas", "landscape"];
149
+ return G = function() {
150
+ return o;
151
+ }, G();
95
152
  }
96
- (function(r, n) {
97
- for (var x = y, e = r(); []; )
153
+ (function(o, n) {
154
+ for (var e = L, x = o(); []; )
98
155
  try {
99
- var i = -parseInt(x(437)) / 1 * (-parseInt(x(438)) / 2) + parseInt(x(442)) / 3 * (parseInt(x(432)) / 4) + -parseInt(x(439)) / 5 * (-parseInt(x(436)) / 6) + -parseInt(x(447)) / 7 + -parseInt(x(434)) / 8 + parseInt(x(433)) / 9 + -parseInt(x(446)) / 10 * (-parseInt(x(441)) / 11);
100
- if (i === n)
156
+ var p = parseInt(e(186)) / 1 * (parseInt(e(181)) / 2) + parseInt(e(177)) / 3 + parseInt(e(180)) / 4 * (-parseInt(e(184)) / 5) + -parseInt(e(183)) / 6 * (parseInt(e(187)) / 7) + -parseInt(e(176)) / 8 * (-parseInt(e(174)) / 9) + -parseInt(e(182)) / 10 + parseInt(e(179)) / 11;
157
+ if (p === n)
101
158
  break;
102
- e.push(e.shift());
103
- } catch (s) {
104
- e.push(e.shift());
159
+ x.push(x.shift());
160
+ } catch (b) {
161
+ x.push(x.shift());
105
162
  }
106
- })(w, 620196);
107
- function y(r, n) {
108
- var x = w();
109
- return y = function(e, i) {
110
- e = e - 432;
111
- var s = x[e];
112
- return s;
113
- }, y(r, n);
163
+ })(M, 137645);
164
+ function L(o, n) {
165
+ var e = M();
166
+ return L = function(x, p) {
167
+ x = x - 172;
168
+ var b = e[x];
169
+ return b;
170
+ }, L(o, n);
114
171
  }
115
- function U(r) {
116
- var n = y;
117
- return { name: n(444), description: n(444), hooks: [{ hook: n(443), name: n(440), description: n(440), priority: 1, run: ({ template: x, options: e }) => {
118
- var i = n;
119
- Object[i(435)](x, i(445), { value: M, enumerable: ![], writable: !![], configurable: !![] });
120
- } }], leastHiprintVersion: "0.3.0" };
172
+ function M() {
173
+ var o = ["30969oTwVoo", "add toPdf Api", "8wHhBkC", "559548rBzwwo", "toPdf", "3110712lnIVuv", "4DFfgVw", "82OKQCWw", "89540jzfgLR", "512610MGUCRx", "1023220TKZNhr", "defineProperty", "1204Tvmeyj", "14qGSnNa", "newPrintTemplate", "add toPdf Api to PrintTemplate", "0.3.0"];
174
+ return M = function() {
175
+ return o;
176
+ }, M();
121
177
  }
122
- function w() {
123
- var r = ["7908523goyyri", "17076opfbYs", "987075HDZSFT", "2837552bcFiTM", "defineProperty", "79998JfzewA", "1zNsKFV", "485556bmEBze", "110MFLttU", "add toPdf Api to PrintTemplate", "3817cLRxoS", "489aaaqip", "newPrintTemplate", "add toPdf Api", "toPdf", "21990nvmIEy"];
124
- return w = function() {
125
- return r;
126
- }, w();
178
+ function E(o) {
179
+ var n = L;
180
+ return { name: "add toPdf Api", description: n(175), hooks: [{ hook: n(188), name: "add toPdf Api to PrintTemplate", description: n(172), priority: 1, run: ({ template: e, options: x }) => {
181
+ var p = n;
182
+ Object[p(185)](e, p(178), { value: U, enumerable: ![], writable: !![], configurable: !![] });
183
+ } }], leastHiprintVersion: n(173) };
127
184
  }
128
185
  export {
129
- U as default
186
+ E as default
130
187
  };
package/dist/index.umd.js CHANGED
@@ -1 +1,33 @@
1
- (function(f,d){typeof exports=="object"&&typeof module!="undefined"?module.exports=d(require("html-to-image"),require("jspdf")):typeof define=="function"&&define.amd?define(["html-to-image","jspdf"],d):(f=typeof globalThis!="undefined"?globalThis:f||self,f.pluginApiPdf=d(f.htmlToImage,f.jspdf))})(this,function(f,d){"use strict";var M=(f,d,v)=>new Promise((w,h)=>{var C=p=>{try{c(v.next(p))}catch(l){h(l)}},I=p=>{try{c(v.throw(p))}catch(l){h(l)}},c=p=>p.done?w(p.value):Promise.resolve(p.value).then(C,I);c((v=v.apply(f,d)).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(f);(function(n,r){for(var t=h,e=n();[];)try{var o=-parseInt(t(219))/1*(-parseInt(t(220))/2)+-parseInt(t(243))/3+-parseInt(t(227))/4+parseInt(t(279))/5*(-parseInt(t(242))/6)+parseInt(t(239))/7*(parseInt(t(266))/8)+-parseInt(t(285))/9+parseInt(t(229))/10;if(o===r)break;e.push(e.shift())}catch(u){e.push(e.shift())}})(I,176031);function h(n,r){var t=I();return h=function(e,o){e=e-218;var u=t[e];return u},h(n,r)}const C=function(n,r,t){return M(this,null,function*(){var e=h,o=this,u=globalThis.$[e(244)](),q=!![];let D=(g,y)=>{var m=e;const i=Math.floor(g/y*100);console.log(m(218),g,m(264),y),console[m(263)]("toPdf percent: ",i+"%")};if(this[e(286)][e(231)]){var k=globalThis[e(269)].mm[e(253)](this[e(286)][0][e(270)]),A=globalThis[e(269)].mm[e(253)](this.printPanels[0][e(223)]),O=globalThis.$.extend({filter:i=>{var x=e;return i.tagName!=x(287)||i.tagName=="IMG"&&([x(222),x(280),x(258),"gif",x(241),x(256),x(230)][x(254)](i.src[x(281)](".")[x(248)]()[x(224)]())||i.src!=i[x(271)]||i.src.indexOf("http")>-1&&i[x(255)]!=i[x(271)]||i[x(255)][x(226)](x(247))>-1)},backgroundColor:e(228)},t||{});const g=this.printPanels[0][e(261)],y=g!=null&&g!=""&&g!=e(221);var P=new d.jsPDF({orientation:this[e(234)](0)==1?"portrait":e(233),unit:"pt",format:y?g[e(262)]():[k,A]}),T=yield this[e(273)](n,t);t&&t[e(277)]!=null&&(q=t.isDownload),t&&t.onProgress!=null&&(D=t.onProgress),globalThis.$(T)[e(265)](e(270),"")[e(265)](e(223),""),this[e(284)]();var _=this[e(267)]();this[e(283)](T,O),_[e(236)](T[0]);let m=_[e(276)](e(272)).length;globalThis.$(T)[e(265)](e(240)),this[e(235)](T,function(){var i=e;try{_[i(276)](".hiprint-printPanel .hiprint-printPaper")[i(237)](function(x,S){var s=i;globalThis[s(269)][s(249)][s(252)](function(L){var a=s;w.toCanvas(S,O)[a(278)](function(j){var b=a,F=j[b(238)]("2d");F[b(274)]=![];var z=j.toDataURL(b(251),O[b(245)]||.92);P[b(232)](z,b(259),0,0,k,A),x<m-1&&P.addPage(),D(x+1,m),L()})}),x==m-1&&(globalThis[s(269)].queue[s(252)](function(L){var a=s;if(q)o.removeTempContainer(),r[a(226)](a(257))>-1?P.save(r):P.save(r+a(257));else{o.removeTempContainer();let j=t[a(282)]||a(246),b=P[a(268)](j);u[a(250)](b)}globalThis[a(269)][a(249)][a(288)]()}),globalThis[s(269)][s(249)][s(225)]())})}catch(x){console[i(275)]("toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "),console.log(x)}})}return u[e(260)]()})};function I(){var n=["126tSCgXA","525129zjKAbq","Deferred","quality","blob","base64","pop","queue","resolve","image/jpeg","add","toPt","includes","src","webp",".pdf","png","JPEG","promise","paperType","toLocaleLowerCase","log","total","css","8896yVUbSh","getTempContainer","output","hinnn","width","baseURI",".hiprint-printPanel .hiprint-printPaper","getHtml","imageSmoothingEnabled","error","find","isDownload","then","48295IFKXEc","jpeg","split","type","svg2canvas","createTempContainer","2474244rLXIHk","printPanels","IMG","clear","cur","28321uPIPma","10pcUdri","\u81EA\u5B9A\u4E49","jpg","height","toLowerCase","run","indexOf","616092WBemXG","#fff","5165430qCcCya","svg","length","addImage","landscape","getOrient","loadAllImages","html","each","getContext","2044bDOmYT","position:fixed","bmp"];return I=function(){return n},I()}(function(n,r){for(var t=c,e=n();[];)try{var o=-parseInt(t(437))/1*(-parseInt(t(438))/2)+parseInt(t(442))/3*(parseInt(t(432))/4)+-parseInt(t(439))/5*(-parseInt(t(436))/6)+-parseInt(t(447))/7+-parseInt(t(434))/8+parseInt(t(433))/9+-parseInt(t(446))/10*(-parseInt(t(441))/11);if(o===r)break;e.push(e.shift())}catch(u){e.push(e.shift())}})(l,620196);function c(n,r){var t=l();return c=function(e,o){e=e-432;var u=t[e];return u},c(n,r)}function p(n){var r=c;return{name:r(444),description:r(444),hooks:[{hook:r(443),name:r(440),description:r(440),priority:1,run:({template:t,options:e})=>{var o=r;Object[o(435)](t,o(445),{value:C,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}function l(){var n=["7908523goyyri","17076opfbYs","987075HDZSFT","2837552bcFiTM","defineProperty","79998JfzewA","1zNsKFV","485556bmEBze","110MFLttU","add toPdf Api to PrintTemplate","3817cLRxoS","489aaaqip","newPrintTemplate","add toPdf Api","toPdf","21990nvmIEy"];return l=function(){return n},l()}return p});
1
+ (function(h,g){typeof exports=="object"&&typeof module!="undefined"?module.exports=g(require("html-to-image"),require("jspdf")):typeof define=="function"&&define.amd?define(["html-to-image","jspdf"],g):(h=typeof globalThis!="undefined"?globalThis:h||self,h.pluginApiPdf=g(h.htmlToImage,h.jspdf))})(this,function(h,g){"use strict";var U=(h,g,P)=>new Promise((L,u)=>{var k=d=>{try{m(P.next(d))}catch(y){u(y)}},v=d=>{try{m(P.throw(d))}catch(y){u(y)}},m=d=>d.done?L(d.value):Promise.resolve(d.value).then(k,v);m((P=P.apply(h,g)).next())});function P(a){if(a&&a.__esModule)return a;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const x=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(n,e,x.get?x:{enumerable:!0,get:()=>a[e]})}}return n.default=a,Object.freeze(n)}const L=P(h);(function(a,n){const e=u,x=a();for(;[];)try{if(parseInt(e(440))/1+parseInt(e(503))/2+parseInt(e(458))/3+parseInt(e(421))/4*(-parseInt(e(472))/5)+-parseInt(e(445))/6+-parseInt(e(488))/7*(parseInt(e(416))/8)+parseInt(e(467))/9===n)break;x.push(x.shift())}catch(f){x.push(x.shift())}})(v,707552);function u(a,n){const e=v();return u=function(x,f){return x=x-415,e[x]},u(a,n)}const k=function(a,n,e){return U(this,null,function*(){const x=u;var f=this,_=globalThis.$.Deferred(),$=!![];let z=(w,I)=>{const b=u,s=Math[b(444)](w/I*100);console[b(453)](b(477),w,b(463),I),console[b(453)](b(451),s+"%")},i=e||{};if(this[x(494)][x(475)]){if(typeof n=="string"){const r=n[x(464)](".pdf")>-1?n:n+x(452);i[x(419)]=r}else i=n||{},!i[x(419)]&&(i.name=x(497)+Date[x(473)]()+x(452));let w=this[x(494)][0][x(493)],I=this[x(494)][0].height;var A=globalThis[x(460)].mm.toPt(i[x(417)]||w),S=globalThis[x(460)].mm[x(449)](i[x(491)]||I),N=globalThis.$[x(489)]({filter:r=>{const t=x;return r[t(434)]!="IMG"||r.tagName=="IMG"&&([t(430),t(448),t(426),"gif",t(465),t(485),t(422)].includes(r[t(481)][t(418)](".")[t(433)]()[t(415)]())||r[t(481)]!=r[t(428)]||r[t(481)][t(464)](t(446))>-1&&r[t(481)]!=r[t(428)]||r.src.indexOf("base64")>-1)},backgroundColor:x(457)},i||{});const b=this.printPanels[0][x(427)],s=this.printPanels[0].panelLayoutOptions,W=s&&(s[x(484)]>0||s[x(483)]>0),B=b!=null&&b!=""&&b!="\u81EA\u5B9A\u4E49";var O=new g.jsPDF({orientation:this[x(486)](0)==1?x(482):x(455),unit:"pt",format:B?b[x(478)]():[A,S]}),T=yield this[x(439)](a,i);i&&i[x(507)]!=null&&($=i[x(507)]),i&&i[x(462)]!=null&&(z=i[x(462)]),globalThis.$(T)[x(469)]("width","").css(x(459),""),this[x(425)]();var q=this.getTempContainer();if(W&&i[x(417)]&&i[x(491)]){let r=Math[x(444)](i[x(417)]/(w+s[x(484)]/2)),t=Math[x(444)](i[x(491)]/(I+s[x(483)]/2));const j=r*t,p=T[x(435)](x(499)),C=p[x(475)],o=Math[x(474)](C/j);let l=globalThis.$(x(431));s[x(438)]=="row"?l[x(447)](x(429)+(Number(s[x(484)])||0)/2+x(468)+(Number(s[x(483)])||0)/2+x(432)+(Number(s.layoutRowGap)||0)/2+x(437)+(Number(s.layoutColumnGap)||0)/2+x(504)):l[x(447)](`<style>
2
+ .hiprint-printPanel-small{
3
+ box-sizing: border-box;
4
+ border: 0px;
5
+ }
6
+ .hiprint-printPaper-small{
7
+ position: relative;
8
+ padding: 0;
9
+ }
10
+ .hiprint-printTemplate .hiprint-printPaper{
11
+ display: flex;
12
+ flex-wrap: wrap;
13
+ flex-direction: column;
14
+ align-content: flex-start;
15
+ margin: -`+(Number(s[x(484)])||0)/2+x(468)+(Number(s[x(483)])||0)/2+x(432)+(Number(s[x(484)])||0)/2+x(437)+(Number(s[x(483)])||0)/2+x(504));for(let c=0;c<o;c++){const M=globalThis.$(`<div class="hiprint-printPanel">
16
+ <div class="hiprint-printPaper" style="width:`+i.paperWidth+x(420)+i[x(491)]+`mm;"></div>
17
+ </div>`),H=c*j,E=Math[x(487)]((c+1)*j,C);for(let G=H;G<E;G++){const R=p.eq(G)[x(505)]();R.removeClass(x(461)),R[x(506)](x(502)+G);const V=globalThis.$('<div class="hiprint-printPanel-small"></div>');V[x(447)](R),M[x(435)](x(443))[x(447)](V)}l[x(447)](M)}this[x(501)](l,N),q[x(466)](l[0]),globalThis.$(l)[x(469)](x(442))}else this[x(501)](T,N),q[x(466)](T[0]),globalThis.$(T)[x(469)](x(442));let D=q.find(".hiprint-printPanel .hiprint-printPaper")[x(475)];this.loadAllImages(T,function(){const r=x;try{q[r(435)](r(499))[r(495)](function(t,j){const p=r;globalThis[p(460)][p(436)][p(498)](function(C){const o=p;L[o(454)](j,N)[o(479)](function(l){const c=o;var M=l[c(496)]("2d");M[c(500)]=![];var H=l[c(423)](c(480),N.quality||.92);O.addImage(H,"JPEG",0,0,A,S),t<D-1&&O.addPage(),z(t+1,D),C()})[o(471)](l=>{const c=o;throw new Error(l[c(456)])})}),t==D-1&&(globalThis[p(460)][p(436)][p(498)](function(C){const o=p;if($)f[o(470)](),O[o(476)](i[o(419)]);else{f[o(470)]();let l=i[o(441)]||o(490),c=O[o(450)](l);_.resolve(c)}globalThis[o(460)][o(436)].clear()}),globalThis[p(460)].queue[p(424)]())})}catch(t){console[r(492)]("toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): "),console[r(453)](t)}})}return _.promise()})};function v(){const a=["message","#fff","4208619DTbSZP","height","hinnn","hiprint-printPaper","onProgress","total","indexOf","bmp","html","5310000eweoHW","mm -","css","removeTempContainer","catch","65gLxMHl","now","ceil","length","save","cur","toLocaleLowerCase","then","image/jpeg","src","portrait","layoutColumnGap","layoutRowGap","webp","getOrient","min","32221ozycqv","extend","blob","paperHeight","error","width","printPanels","each","getContext","sv-print-","add",".hiprint-printPanel .hiprint-printPaper","imageSmoothingEnabled","svg2canvas","hiprint-printPaper-small start-","263716JLHqhL",`mm;
18
+ }
19
+ </style>`,"clone","addClass","isDownload","toLowerCase","1064OQuVRs","paperWidth","split","name","mm;height:","252012TUBfqm","svg","toDataURL","run","createTempContainer","png","paperType","baseURI",`<style>
20
+ .hiprint-printPanel-small{
21
+ box-sizing: border-box;
22
+ border: 0px;
23
+ }
24
+ .hiprint-printPaper-small{
25
+ position: relative;
26
+ padding: 0;
27
+ }
28
+ .hiprint-printTemplate .hiprint-printPaper{
29
+ margin: -`,"jpg",'<div class="hiprint-printTemplate"></div>',`mm;
30
+ }
31
+ .hiprint-printTemplate .hiprint-printPanel-small {
32
+ display:inline-block;
33
+ padding: `,"pop","tagName","find","queue","mm ","layoutType","getHtml","403090NSIRHY","type","position:fixed",".hiprint-printPaper","floor","2334186Csqjzd","http","append","jpeg","toPt","output","toPdf percent: ",".pdf","log","toCanvas","landscape"];return v=function(){return a},v()}(function(a,n){for(var e=m,x=a();[];)try{var f=parseInt(e(186))/1*(parseInt(e(181))/2)+parseInt(e(177))/3+parseInt(e(180))/4*(-parseInt(e(184))/5)+-parseInt(e(183))/6*(parseInt(e(187))/7)+-parseInt(e(176))/8*(-parseInt(e(174))/9)+-parseInt(e(182))/10+parseInt(e(179))/11;if(f===n)break;x.push(x.shift())}catch(_){x.push(x.shift())}})(d,137645);function m(a,n){var e=d();return m=function(x,f){x=x-172;var _=e[x];return _},m(a,n)}function d(){var a=["30969oTwVoo","add toPdf Api","8wHhBkC","559548rBzwwo","toPdf","3110712lnIVuv","4DFfgVw","82OKQCWw","89540jzfgLR","512610MGUCRx","1023220TKZNhr","defineProperty","1204Tvmeyj","14qGSnNa","newPrintTemplate","add toPdf Api to PrintTemplate","0.3.0"];return d=function(){return a},d()}function y(a){var n=m;return{name:"add toPdf Api",description:n(175),hooks:[{hook:n(188),name:"add toPdf Api to PrintTemplate",description:n(172),priority:1,run:({template:e,options:x})=>{var f=n;Object[f(185)](e,f(178),{value:k,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:n(173)}}return y});
package/dist/toPdf.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const toPdf: (t: any, e: any, options: any) => Promise<any>;
1
+ declare const toPdf: (printData: any, nameOrOptions: any, oldOpt: any) => Promise<any>;
2
2
  export { toPdf };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sv-print/plugin-api-pdf",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "add pdf api to print template",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",