@sv-print/plugin-api-pdf3 0.1.1 → 0.2.0

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,35 @@
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;
1
+ "use strict";var j=(n,a,e)=>new Promise((x,o)=>{var c=t=>{try{f(e.next(t))}catch(m){o(m)}},I=t=>{try{f(e.throw(t))}catch(m){o(m)}},f=t=>t.done?x(t.value):Promise.resolve(t.value).then(c,I);f((e=e.apply(n,a)).next())});const z=require("@zumer/snapdom"),A=require("jspdf");function T(n,a){const e=q();return T=function(x,o){return x=x-167,e[x]},T(n,a)}(function(n,a){const e=T,x=n();for(;[];)try{if(parseInt(e(215))/1+-parseInt(e(203))/2+-parseInt(e(240))/3*(parseInt(e(184))/4)+-parseInt(e(231))/5*(parseInt(e(247))/6)+-parseInt(e(222))/7*(-parseInt(e(242))/8)+parseInt(e(185))/9+parseInt(e(235))/10===a)break;x.push(x.shift())}catch(o){x.push(x.shift())}})(q,686546);const J=function(n,a,e){return j(this,null,function*(){const x=T;var o=this,c=globalThis.$.Deferred(),I=!![];let f=(P,v)=>{const b=T,i=Math[b(216)](P/v*100);console[b(230)](b(220),P,"total",v),console.log("toPdf percent: ",i+"%")},t=e||{};if(this[x(228)][x(238)]){if(typeof a=="string"){const l=a[x(183)](".pdf")>-1?a:a+".pdf";t[x(236)]=l}else t=a||{},!t[x(236)]&&(t.name="sv-print-"+Date[x(181)]()+x(187));let P=this[x(228)][0][x(179)],v=this[x(228)][0][x(173)];var m=globalThis.hinnn.mm[x(180)](t[x(233)]||P),O=globalThis[x(171)].mm[x(180)](t[x(207)]||v),u=globalThis.$[x(241)]({},t||{});const b=this.printPanels[0][x(208)],i=this.printPanels[0][x(218)],E=i&&(i[x(212)]>0||i.layoutColumnGap>0),H=b!=null&&b!=""&&b!=x(223);var w=new A.jsPDF({orientation:this.getOrient(0)==1?x(219):"landscape",unit:"pt",format:H?b[x(239)]():[m,O]}),g=yield this.getHtml(n,t);t&&(t[x(188)]&&(u[x(194)]=t.pixelRatio,u[x(205)]=t[x(188)]),t[x(237)]!=null&&(I=t[x(237)]),t[x(200)]!=null&&(f=t[x(200)])),globalThis.$(g)[x(244)](x(179),"").css(x(173),""),this[x(245)]();var C=this.getTempContainer();if(E&&t[x(233)]&&t.paperHeight){let l=Math[x(216)](t[x(233)]/(P+i.layoutRowGap/2)),h=Math.floor(t[x(207)]/(v+i[x(197)]/2));const _=l*h,d=g.find(".hiprint-printPanel .hiprint-printPaper"),y=d.length,s=Math.ceil(y/_);let p=globalThis.$(x(170));i[x(176)]==x(248)?p.append(`<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
+ margin: -`+(Number(i[x(212)])||0)/2+x(177)+(Number(i[x(197)])||0)/2+x(227)+(Number(i[x(212)])||0)/2+x(226)+(Number(i.layoutColumnGap)||0)/2+`mm;
12
+ }
13
+ </style>`):p[x(191)](x(225)+(Number(i[x(212)])||0)/2+"mm -"+(Number(i[x(197)])||0)/2+x(227)+(Number(i.layoutRowGap)||0)/2+"mm "+(Number(i[x(197)])||0)/2+x(186));for(let r=0;r<s;r++){const N=globalThis.$(x(178)+t[x(233)]+x(224)+t.paperHeight+x(213)),D=r*_,Y=Math[x(196)]((r+1)*_,y);for(let R=D;R<Y;R++){const G=d.eq(R)[x(189)]();G.removeClass(x(246)),G[x(217)](x(214)+R);const V=globalThis.$('<div class="hiprint-printPanel-small"></div>');V[x(191)](G),N[x(202)](x(201)).append(V)}p[x(191)](N)}this[x(167)](p,u),C[x(211)](p[0]),globalThis.$(p)[x(244)](x(168))}else this[x(167)](g,u),C[x(211)](g[0]),globalThis.$(g)[x(244)](x(168));let k=C[x(202)](x(243))[x(238)];this[x(199)](g,function(){const l=x;try{C[l(202)](l(243)).each(function(h,_){const d=l;globalThis[d(171)][d(232)].add(function(y){const s=d;z.snapdom.toCanvas(_,u)[s(198)](function(p){const r=s;var N=p[r(234)]("2d");N[r(193)]=![];var D=p[r(182)](r(192),u.quality||.92);w[r(169)](D,r(195),0,0,m,O),h<k-1&&w[r(190)](),f(h+1,k),y()})[s(174)](p=>{throw new Error(p.message)})}),h==k-1&&(globalThis[d(171)].queue[d(206)](function(y){const s=d;if(I)o.removeTempContainer(),w[s(221)](t[s(236)]);else{o.removeTempContainer();let p=t[s(204)]||"blob",r=w[s(172)](p);c[s(229)](r)}globalThis[s(171)][s(232)].clear()}),globalThis.hinnn.queue.run())})}catch(h){console[l(209)](l(175)),console[l(230)](h)}})}return c[x(210)]()})};function q(){const n=["870396MNVKbV","type","scale","add","paperHeight","paperType","error","promise","html","layoutRowGap",`mm;"></div>
14
+ </div>`,"hiprint-printPaper-small start-","817870sRwNtd","floor","addClass","panelLayoutOptions","portrait","cur","save","36393lfxVEX","\u81EA\u5B9A\u4E49","mm;height:",`<style>
15
+ .hiprint-printPanel-small{
16
+ box-sizing: border-box;
17
+ border: 0px;
18
+ }
19
+ .hiprint-printPaper-small{
20
+ position: relative;
21
+ padding: 0;
22
+ }
23
+ .hiprint-printTemplate .hiprint-printPaper{
24
+ display: flex;
25
+ flex-wrap: wrap;
26
+ flex-direction: column;
27
+ align-content: flex-start;
28
+ margin: -`,"mm ",`mm;
29
+ }
30
+ .hiprint-printTemplate .hiprint-printPanel-small {
31
+ display:inline-block;
32
+ padding: `,"printPanels","resolve","log","465JYscVO","queue","paperWidth","getContext","1830570nhlfoR","name","isDownload","length","toLocaleLowerCase","453RnbkRT","extend","824JuXcAV",".hiprint-printPanel .hiprint-printPaper","css","createTempContainer","hiprint-printPaper","57762hBjdeZ","row","svg2canvas","position:fixed","addImage",'<div class="hiprint-printTemplate"></div>',"hinnn","output","height","catch","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","layoutType","mm -",`<div class="hiprint-printPanel">
33
+ <div class="hiprint-printPaper" style="width:`,"width","toPt","now","toDataURL","indexOf","21820PdnyNC","11739024gYkaDO",`mm;
34
+ }
35
+ </style>`,".pdf","pixelRatio","clone","addPage","append","image/jpeg","imageSmoothingEnabled","dpr","JPEG","min","layoutColumnGap","then","loadAllImages","onProgress",".hiprint-printPaper","find"];return q=function(){return n},q()}(function(n,a){for(var e=M,x=n();[];)try{var o=parseInt(e(491))/1*(-parseInt(e(490))/2)+parseInt(e(495))/3+-parseInt(e(487))/4+parseInt(e(484))/5*(parseInt(e(494))/6)+-parseInt(e(493))/7*(parseInt(e(488))/8)+-parseInt(e(497))/9+parseInt(e(485))/10;if(o===a)break;x.push(x.shift())}catch(c){x.push(x.shift())}})($,444814);function M(n,a){var e=$();return M=function(x,o){x=x-484;var c=e[x];return c},M(n,a)}function $(){var n=["11800220KdCSqW","add toPdf Api to PrintTemplate","149712dcKDWM","36112hbQYCs","toPdf","31846ymriPr","23eWdTxC","newPrintTemplate","602uMlddO","44490VKEqul","1166520yrTloY","add toPdf Api","5859288JZXlPB","215YCzUPc"];return $=function(){return n},$()}function K(n){var a=M;return{name:a(496),description:a(496),hooks:[{hook:a(492),name:a(486),description:a(486),priority:1,run:({template:e,options:x})=>{var o=a;Object.defineProperty(e,o(489),{value:J,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}module.exports=K;
package/dist/index.mjs CHANGED
@@ -1,130 +1,185 @@
1
- var k = (r, a, t) => new Promise((x, o) => {
2
- var s = (p) => {
1
+ var E = (n, a, e) => new Promise((x, o) => {
2
+ var c = (t) => {
3
3
  try {
4
- d(t.next(p));
5
- } catch (u) {
6
- o(u);
4
+ f(e.next(t));
5
+ } catch (m) {
6
+ o(m);
7
7
  }
8
- }, b = (p) => {
8
+ }, I = (t) => {
9
9
  try {
10
- d(t.throw(p));
11
- } catch (u) {
12
- o(u);
10
+ f(e.throw(t));
11
+ } catch (m) {
12
+ o(m);
13
13
  }
14
- }, d = (p) => p.done ? x(p.value) : Promise.resolve(p.value).then(s, b);
15
- d((t = t.apply(r, a)).next());
14
+ }, f = (t) => t.done ? x(t.value) : Promise.resolve(t.value).then(c, I);
15
+ f((e = e.apply(n, a)).next());
16
16
  });
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(); []; )
17
+ import { snapdom as A } from "@zumer/snapdom";
18
+ import { jsPDF as J } from "jspdf";
19
+ function T(n, a) {
20
+ const e = M();
21
+ return T = function(x, o) {
22
+ return x = x - 167, e[x];
23
+ }, T(n, a);
24
+ }
25
+ (function(n, a) {
26
+ const e = T, x = n();
27
+ for (; []; )
21
28
  try {
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)
29
+ if (parseInt(e(215)) / 1 + -parseInt(e(203)) / 2 + -parseInt(e(240)) / 3 * (parseInt(e(184)) / 4) + -parseInt(e(231)) / 5 * (parseInt(e(247)) / 6) + -parseInt(e(222)) / 7 * (-parseInt(e(242)) / 8) + parseInt(e(185)) / 9 + parseInt(e(235)) / 10 === a)
24
30
  break;
25
31
  x.push(x.shift());
26
- } catch (s) {
32
+ } catch (o) {
27
33
  x.push(x.shift());
28
34
  }
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
- }
38
- function T() {
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"];
40
- return T = function() {
41
- return r;
42
- }, T();
43
- }
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
- };
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;
35
+ })(M, 686546);
36
+ const K = function(n, a, e) {
37
+ return E(this, null, function* () {
38
+ const x = T;
39
+ var o = this, c = globalThis.$.Deferred(), I = !![];
40
+ let f = (P, v) => {
41
+ const b = T, i = Math[b(216)](P / v * 100);
42
+ console[b(230)](b(220), P, "total", v), console.log("toPdf percent: ", i + "%");
43
+ }, t = e || {};
44
+ if (this[x(228)][x(238)]) {
45
+ if (typeof a == "string") {
46
+ const l = a[x(183)](".pdf") > -1 ? a : a + ".pdf";
47
+ t[x(236)] = l;
48
+ } else
49
+ t = a || {}, !t[x(236)] && (t.name = "sv-print-" + Date[x(181)]() + x(187));
50
+ let P = this[x(228)][0][x(179)], v = this[x(228)][0][x(173)];
51
+ var m = globalThis.hinnn.mm[x(180)](t[x(233)] || P), O = globalThis[x(171)].mm[x(180)](t[x(207)] || v), u = globalThis.$[x(241)]({}, t || {});
52
+ const b = this.printPanels[0][x(208)], i = this.printPanels[0][x(218)], H = i && (i[x(212)] > 0 || i.layoutColumnGap > 0), Y = b != null && b != "" && b != x(223);
53
+ var w = new J({ orientation: this.getOrient(0) == 1 ? x(219) : "landscape", unit: "pt", format: Y ? b[x(239)]() : [m, O] }), g = yield this.getHtml(n, t);
54
+ t && (t[x(188)] && (u[x(194)] = t.pixelRatio, u[x(205)] = t[x(188)]), t[x(237)] != null && (I = t[x(237)]), t[x(200)] != null && (f = t[x(200)])), globalThis.$(g)[x(244)](x(179), "").css(x(173), ""), this[x(245)]();
55
+ var C = this.getTempContainer();
56
+ if (H && t[x(233)] && t.paperHeight) {
57
+ let l = Math[x(216)](t[x(233)] / (P + i.layoutRowGap / 2)), h = Math.floor(t[x(207)] / (v + i[x(197)] / 2));
58
+ const _ = l * h, d = g.find(".hiprint-printPanel .hiprint-printPaper"), y = d.length, p = Math.ceil(y / _);
59
+ let s = globalThis.$(x(170));
60
+ i[x(176)] == x(248) ? s.append(`<style>
61
+ .hiprint-printPanel-small{
62
+ box-sizing: border-box;
63
+ border: 0px;
64
+ }
65
+ .hiprint-printPaper-small{
66
+ position: relative;
67
+ padding: 0;
68
+ }
69
+ .hiprint-printTemplate .hiprint-printPaper{
70
+ margin: -` + (Number(i[x(212)]) || 0) / 2 + x(177) + (Number(i[x(197)]) || 0) / 2 + x(227) + (Number(i[x(212)]) || 0) / 2 + x(226) + (Number(i.layoutColumnGap) || 0) / 2 + `mm;
71
+ }
72
+ </style>`) : s[x(191)](x(225) + (Number(i[x(212)]) || 0) / 2 + "mm -" + (Number(i[x(197)]) || 0) / 2 + x(227) + (Number(i.layoutRowGap) || 0) / 2 + "mm " + (Number(i[x(197)]) || 0) / 2 + x(186));
73
+ for (let r = 0; r < p; r++) {
74
+ const N = globalThis.$(x(178) + t[x(233)] + x(224) + t.paperHeight + x(213)), D = r * _, j = Math[x(196)]((r + 1) * _, y);
75
+ for (let R = D; R < j; R++) {
76
+ const G = d.eq(R)[x(189)]();
77
+ G.removeClass(x(246)), G[x(217)](x(214) + R);
78
+ const V = globalThis.$('<div class="hiprint-printPanel-small"></div>');
79
+ V[x(191)](G), N[x(202)](x(201)).append(V);
80
+ }
81
+ s[x(191)](N);
82
+ }
83
+ this[x(167)](s, u), C[x(211)](s[0]), globalThis.$(s)[x(244)](x(168));
84
+ } else
85
+ this[x(167)](g, u), C[x(211)](g[0]), globalThis.$(g)[x(244)](x(168));
86
+ let q = C[x(202)](x(243))[x(238)];
87
+ this[x(199)](g, function() {
88
+ const l = x;
65
89
  try {
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();
90
+ C[l(202)](l(243)).each(function(h, _) {
91
+ const d = l;
92
+ globalThis[d(171)][d(232)].add(function(y) {
93
+ const p = d;
94
+ A.toCanvas(_, u)[p(198)](function(s) {
95
+ const r = p;
96
+ var N = s[r(234)]("2d");
97
+ N[r(193)] = ![];
98
+ var D = s[r(182)](r(192), u.quality || 0.92);
99
+ w[r(169)](D, r(195), 0, 0, m, O), h < q - 1 && w[r(190)](), f(h + 1, q), y();
100
+ })[p(174)]((s) => {
101
+ throw new Error(s.message);
75
102
  });
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));
103
+ }), h == q - 1 && (globalThis[d(171)].queue[d(206)](function(y) {
104
+ const p = d;
105
+ if (I)
106
+ o.removeTempContainer(), w[p(221)](t[p(236)]);
80
107
  else {
81
- o[i(356)]();
82
- let P = t[i(348)] || i(343), l = g[i(333)](P);
83
- s[i(304)](l);
108
+ o.removeTempContainer();
109
+ let s = t[p(204)] || "blob", r = w[p(172)](s);
110
+ c[p(229)](r);
84
111
  }
85
- globalThis[i(353)].queue[i(336)]();
86
- }), globalThis.hinnn[c(313)].run());
112
+ globalThis[p(171)][p(232)].clear();
113
+ }), globalThis.hinnn.queue.run());
87
114
  });
88
- } catch (e) {
89
- console[n(299)](n(361)), console[n(334)](e);
115
+ } catch (h) {
116
+ console[l(209)](l(175)), console[l(230)](h);
90
117
  }
91
118
  });
92
119
  }
93
- return s[x(337)]();
120
+ return c[x(210)]();
94
121
  });
95
122
  };
96
- (function(r, a) {
97
- for (var t = w, x = r(); []; )
123
+ function M() {
124
+ const n = ["870396MNVKbV", "type", "scale", "add", "paperHeight", "paperType", "error", "promise", "html", "layoutRowGap", `mm;"></div>
125
+ </div>`, "hiprint-printPaper-small start-", "817870sRwNtd", "floor", "addClass", "panelLayoutOptions", "portrait", "cur", "save", "36393lfxVEX", "\u81EA\u5B9A\u4E49", "mm;height:", `<style>
126
+ .hiprint-printPanel-small{
127
+ box-sizing: border-box;
128
+ border: 0px;
129
+ }
130
+ .hiprint-printPaper-small{
131
+ position: relative;
132
+ padding: 0;
133
+ }
134
+ .hiprint-printTemplate .hiprint-printPaper{
135
+ display: flex;
136
+ flex-wrap: wrap;
137
+ flex-direction: column;
138
+ align-content: flex-start;
139
+ margin: -`, "mm ", `mm;
140
+ }
141
+ .hiprint-printTemplate .hiprint-printPanel-small {
142
+ display:inline-block;
143
+ padding: `, "printPanels", "resolve", "log", "465JYscVO", "queue", "paperWidth", "getContext", "1830570nhlfoR", "name", "isDownload", "length", "toLocaleLowerCase", "453RnbkRT", "extend", "824JuXcAV", ".hiprint-printPanel .hiprint-printPaper", "css", "createTempContainer", "hiprint-printPaper", "57762hBjdeZ", "row", "svg2canvas", "position:fixed", "addImage", '<div class="hiprint-printTemplate"></div>', "hinnn", "output", "height", "catch", "toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ", "layoutType", "mm -", `<div class="hiprint-printPanel">
144
+ <div class="hiprint-printPaper" style="width:`, "width", "toPt", "now", "toDataURL", "indexOf", "21820PdnyNC", "11739024gYkaDO", `mm;
145
+ }
146
+ </style>`, ".pdf", "pixelRatio", "clone", "addPage", "append", "image/jpeg", "imageSmoothingEnabled", "dpr", "JPEG", "min", "layoutColumnGap", "then", "loadAllImages", "onProgress", ".hiprint-printPaper", "find"];
147
+ return M = function() {
148
+ return n;
149
+ }, M();
150
+ }
151
+ (function(n, a) {
152
+ for (var e = $, x = n(); []; )
98
153
  try {
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);
154
+ var o = parseInt(e(491)) / 1 * (-parseInt(e(490)) / 2) + parseInt(e(495)) / 3 + -parseInt(e(487)) / 4 + parseInt(e(484)) / 5 * (parseInt(e(494)) / 6) + -parseInt(e(493)) / 7 * (parseInt(e(488)) / 8) + -parseInt(e(497)) / 9 + parseInt(e(485)) / 10;
100
155
  if (o === a)
101
156
  break;
102
157
  x.push(x.shift());
103
- } catch (s) {
158
+ } catch (c) {
104
159
  x.push(x.shift());
105
160
  }
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
- return s;
113
- }, w(r, a);
161
+ })(k, 444814);
162
+ function $(n, a) {
163
+ var e = k();
164
+ return $ = function(x, o) {
165
+ x = x - 484;
166
+ var c = e[x];
167
+ return c;
168
+ }, $(n, a);
114
169
  }
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 }) => {
170
+ function k() {
171
+ var n = ["11800220KdCSqW", "add toPdf Api to PrintTemplate", "149712dcKDWM", "36112hbQYCs", "toPdf", "31846ymriPr", "23eWdTxC", "newPrintTemplate", "602uMlddO", "44490VKEqul", "1166520yrTloY", "add toPdf Api", "5859288JZXlPB", "215YCzUPc"];
172
+ return k = function() {
173
+ return n;
174
+ }, k();
175
+ }
176
+ function X(n) {
177
+ var a = $;
178
+ return { name: a(496), description: a(496), hooks: [{ hook: a(492), name: a(486), description: a(486), priority: 1, run: ({ template: e, options: x }) => {
118
179
  var o = a;
119
- Object[o(284)](t, o(290), { value: H, enumerable: ![], writable: !![], configurable: !![] });
180
+ Object.defineProperty(e, o(489), { value: K, enumerable: ![], writable: !![], configurable: !![] });
120
181
  } }], leastHiprintVersion: "0.3.0" };
121
182
  }
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
- }
128
183
  export {
129
- N as default
184
+ X as default
130
185
  };
package/dist/index.umd.js CHANGED
@@ -1 +1,35 @@
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});
1
+ (function(c,b){typeof exports=="object"&&typeof module!="undefined"?module.exports=b(require("@zumer/snapdom"),require("jspdf")):typeof define=="function"&&define.amd?define(["@zumer/snapdom","jspdf"],b):(c=typeof globalThis!="undefined"?globalThis:c||self,c.pluginApiPdf=b(c.snapdom,c.jspdf))})(this,function(c,b){"use strict";var H=(c,b,s)=>new Promise(($,u)=>{var g=a=>{try{T(s.next(a))}catch(t){u(t)}},P=a=>{try{T(s.throw(a))}catch(t){u(t)}},T=a=>a.done?$(a.value):Promise.resolve(a.value).then(g,P);T((s=s.apply(c,b)).next())});function s(a,t){const e=u();return s=function(x,l){return x=x-167,e[x]},s(a,t)}(function(a,t){const e=s,x=a();for(;[];)try{if(parseInt(e(215))/1+-parseInt(e(203))/2+-parseInt(e(240))/3*(parseInt(e(184))/4)+-parseInt(e(231))/5*(parseInt(e(247))/6)+-parseInt(e(222))/7*(-parseInt(e(242))/8)+parseInt(e(185))/9+parseInt(e(235))/10===t)break;x.push(x.shift())}catch(l){x.push(x.shift())}})(u,686546);const $=function(a,t,e){return H(this,null,function*(){const x=s;var l=this,v=globalThis.$.Deferred(),O=!![];let V=(I,w)=>{const h=s,i=Math[h(216)](I/w*100);console[h(230)](h(220),I,"total",w),console.log("toPdf percent: ",i+"%")},n=e||{};if(this[x(228)][x(238)]){if(typeof t=="string"){const d=t[x(183)](".pdf")>-1?t:t+".pdf";n[x(236)]=d}else n=t||{},!n[x(236)]&&(n.name="sv-print-"+Date[x(181)]()+x(187));let I=this[x(228)][0][x(179)],w=this[x(228)][0][x(173)];var z=globalThis.hinnn.mm[x(180)](n[x(233)]||I),A=globalThis[x(171)].mm[x(180)](n[x(207)]||w),_=globalThis.$[x(241)]({},n||{});const h=this.printPanels[0][x(208)],i=this.printPanels[0][x(218)],Y=i&&(i[x(212)]>0||i.layoutColumnGap>0),J=h!=null&&h!=""&&h!=x(223);var R=new b.jsPDF({orientation:this.getOrient(0)==1?x(219):"landscape",unit:"pt",format:J?h[x(239)]():[z,A]}),y=yield this.getHtml(a,n);n&&(n[x(188)]&&(_[x(194)]=n.pixelRatio,_[x(205)]=n[x(188)]),n[x(237)]!=null&&(O=n[x(237)]),n[x(200)]!=null&&(V=n[x(200)])),globalThis.$(y)[x(244)](x(179),"").css(x(173),""),this[x(245)]();var q=this.getTempContainer();if(Y&&n[x(233)]&&n.paperHeight){let d=Math[x(216)](n[x(233)]/(I+i.layoutRowGap/2)),m=Math.floor(n[x(207)]/(w+i[x(197)]/2));const C=d*m,f=y.find(".hiprint-printPanel .hiprint-printPaper"),N=f.length,o=Math.ceil(N/C);let p=globalThis.$(x(170));i[x(176)]==x(248)?p.append(`<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
+ margin: -`+(Number(i[x(212)])||0)/2+x(177)+(Number(i[x(197)])||0)/2+x(227)+(Number(i[x(212)])||0)/2+x(226)+(Number(i.layoutColumnGap)||0)/2+`mm;
12
+ }
13
+ </style>`):p[x(191)](x(225)+(Number(i[x(212)])||0)/2+"mm -"+(Number(i[x(197)])||0)/2+x(227)+(Number(i.layoutRowGap)||0)/2+"mm "+(Number(i[x(197)])||0)/2+x(186));for(let r=0;r<o;r++){const j=globalThis.$(x(178)+n[x(233)]+x(224)+n.paperHeight+x(213)),D=r*C,K=Math[x(196)]((r+1)*C,N);for(let M=D;M<K;M++){const G=f.eq(M)[x(189)]();G.removeClass(x(246)),G[x(217)](x(214)+M);const E=globalThis.$('<div class="hiprint-printPanel-small"></div>');E[x(191)](G),j[x(202)](x(201)).append(E)}p[x(191)](j)}this[x(167)](p,_),q[x(211)](p[0]),globalThis.$(p)[x(244)](x(168))}else this[x(167)](y,_),q[x(211)](y[0]),globalThis.$(y)[x(244)](x(168));let k=q[x(202)](x(243))[x(238)];this[x(199)](y,function(){const d=x;try{q[d(202)](d(243)).each(function(m,C){const f=d;globalThis[f(171)][f(232)].add(function(N){const o=f;c.snapdom.toCanvas(C,_)[o(198)](function(p){const r=o;var j=p[r(234)]("2d");j[r(193)]=![];var D=p[r(182)](r(192),_.quality||.92);R[r(169)](D,r(195),0,0,z,A),m<k-1&&R[r(190)](),V(m+1,k),N()})[o(174)](p=>{throw new Error(p.message)})}),m==k-1&&(globalThis[f(171)].queue[f(206)](function(N){const o=f;if(O)l.removeTempContainer(),R[o(221)](n[o(236)]);else{l.removeTempContainer();let p=n[o(204)]||"blob",r=R[o(172)](p);v[o(229)](r)}globalThis[o(171)][o(232)].clear()}),globalThis.hinnn.queue.run())})}catch(m){console[d(209)](d(175)),console[d(230)](m)}})}return v[x(210)]()})};function u(){const a=["870396MNVKbV","type","scale","add","paperHeight","paperType","error","promise","html","layoutRowGap",`mm;"></div>
14
+ </div>`,"hiprint-printPaper-small start-","817870sRwNtd","floor","addClass","panelLayoutOptions","portrait","cur","save","36393lfxVEX","\u81EA\u5B9A\u4E49","mm;height:",`<style>
15
+ .hiprint-printPanel-small{
16
+ box-sizing: border-box;
17
+ border: 0px;
18
+ }
19
+ .hiprint-printPaper-small{
20
+ position: relative;
21
+ padding: 0;
22
+ }
23
+ .hiprint-printTemplate .hiprint-printPaper{
24
+ display: flex;
25
+ flex-wrap: wrap;
26
+ flex-direction: column;
27
+ align-content: flex-start;
28
+ margin: -`,"mm ",`mm;
29
+ }
30
+ .hiprint-printTemplate .hiprint-printPanel-small {
31
+ display:inline-block;
32
+ padding: `,"printPanels","resolve","log","465JYscVO","queue","paperWidth","getContext","1830570nhlfoR","name","isDownload","length","toLocaleLowerCase","453RnbkRT","extend","824JuXcAV",".hiprint-printPanel .hiprint-printPaper","css","createTempContainer","hiprint-printPaper","57762hBjdeZ","row","svg2canvas","position:fixed","addImage",'<div class="hiprint-printTemplate"></div>',"hinnn","output","height","catch","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","layoutType","mm -",`<div class="hiprint-printPanel">
33
+ <div class="hiprint-printPaper" style="width:`,"width","toPt","now","toDataURL","indexOf","21820PdnyNC","11739024gYkaDO",`mm;
34
+ }
35
+ </style>`,".pdf","pixelRatio","clone","addPage","append","image/jpeg","imageSmoothingEnabled","dpr","JPEG","min","layoutColumnGap","then","loadAllImages","onProgress",".hiprint-printPaper","find"];return u=function(){return a},u()}(function(a,t){for(var e=g,x=a();[];)try{var l=parseInt(e(491))/1*(-parseInt(e(490))/2)+parseInt(e(495))/3+-parseInt(e(487))/4+parseInt(e(484))/5*(parseInt(e(494))/6)+-parseInt(e(493))/7*(parseInt(e(488))/8)+-parseInt(e(497))/9+parseInt(e(485))/10;if(l===t)break;x.push(x.shift())}catch(v){x.push(x.shift())}})(P,444814);function g(a,t){var e=P();return g=function(x,l){x=x-484;var v=e[x];return v},g(a,t)}function P(){var a=["11800220KdCSqW","add toPdf Api to PrintTemplate","149712dcKDWM","36112hbQYCs","toPdf","31846ymriPr","23eWdTxC","newPrintTemplate","602uMlddO","44490VKEqul","1166520yrTloY","add toPdf Api","5859288JZXlPB","215YCzUPc"];return P=function(){return a},P()}function T(a){var t=g;return{name:t(496),description:t(496),hooks:[{hook:t(492),name:t(486),description:t(486),priority:1,run:({template:e,options:x})=>{var l=t;Object.defineProperty(e,l(489),{value:$,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:"0.3.0"}}return T});
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-pdf3",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "add pdf api to print template",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,13 +34,13 @@
34
34
  "dependencies": {
35
35
  "sv-print": "^0.2.0",
36
36
  "jspdf": "^3.0.2",
37
- "html-to-image": "^1.11.13"
37
+ "@zumer/snapdom": "^2.0.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "vite-plugin-javascript-obfuscator": "^3.1.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "sv-print": "^0.2.0",
44
- "html-to-image": "^1.11.13"
44
+ "@zumer/snapdom": "^2.0.1"
45
45
  }
46
46
  }