@sv-print/plugin-api-pdf 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,39 @@
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 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;
2
+ }
3
+ .hiprint-printTemplate .hiprint-printPanel-small {
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>
6
+ .hiprint-printPanel-small{
7
+ box-sizing: border-box;
8
+ border: 0px;
9
+ }
10
+ .hiprint-printPaper-small{
11
+ position: relative;
12
+ padding: 0;
13
+ }
14
+ .hiprint-printTemplate .hiprint-printPaper{
15
+ display: flex;
16
+ flex-wrap: wrap;
17
+ flex-direction: column;
18
+ align-content: flex-start;
19
+ margin: -`+(Number(i[x(141)])||0)/2+x(184)+(Number(i.layoutColumnGap)||0)/2+`mm;
20
+ }
21
+ .hiprint-printTemplate .hiprint-printPanel-small {
22
+ 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>
29
+ .hiprint-printPanel-small{
30
+ box-sizing: border-box;
31
+ border: 0px;
32
+ }
33
+ .hiprint-printPaper-small{
34
+ position: relative;
35
+ padding: 0;
36
+ }
37
+ .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;
package/dist/index.mjs CHANGED
@@ -1,130 +1,190 @@
1
- var j = (r, n, x) => new Promise((e, i) => {
2
- var s = (f) => {
1
+ var O = (e, n, a) => new Promise((x, p) => {
2
+ var l = (t) => {
3
3
  try {
4
- h(x.next(f));
5
- } catch (u) {
6
- i(u);
4
+ f(a.next(t));
5
+ } catch (m) {
6
+ p(m);
7
7
  }
8
- }, v = (f) => {
8
+ }, I = (t) => {
9
9
  try {
10
- h(x.throw(f));
11
- } catch (u) {
12
- i(u);
10
+ f(a.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
+ }, f = (t) => t.done ? x(t.value) : Promise.resolve(t.value).then(l, I);
15
+ f((a = a.apply(e, 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 { snapdom as J } from "@zumer/snapdom";
18
+ import { jsPDF as Q } from "jspdf";
19
+ (function(e, n) {
20
+ const a = b, x = e();
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(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)
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
+ })(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);
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(e, n, a) {
37
+ 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 + "%");
43
+ }, 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;
48
+ } 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;
61
+ }
62
+ .hiprint-printTemplate .hiprint-printPanel-small {
63
+ display:inline-block;
64
+ padding: ` + (Number(i[x(141)]) || 0) / 2 + x(163) + (Number(i.layoutColumnGap) || 0) / 2 + x(185)) : s[x(129)](`<style>
65
+ .hiprint-printPanel-small{
66
+ box-sizing: border-box;
67
+ border: 0px;
68
+ }
69
+ .hiprint-printPaper-small{
70
+ position: relative;
71
+ padding: 0;
72
+ }
73
+ .hiprint-printTemplate .hiprint-printPaper{
74
+ display: flex;
75
+ flex-wrap: wrap;
76
+ flex-direction: column;
77
+ 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);
92
+ }
93
+ s[x(129)](G);
94
+ }
95
+ this.svg2canvas(s, u), C[x(200)](s[0]), globalThis.$(s).css(x(164));
96
+ } 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;
59
101
  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();
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)]);
69
115
  });
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));
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);
74
120
  else {
75
- i.removeTempContainer();
76
- let I = x[o(282)] || o(246), l = d[o(268)](I);
77
- s[o(250)](l);
121
+ p[r(155)]();
122
+ let s = t[r(128)] || "blob", o = w[r(182)](s);
123
+ l.resolve(o);
78
124
  }
79
- globalThis[o(269)][o(249)][o(288)]();
80
- }), globalThis[p(269)][p(249)][p(225)]());
125
+ globalThis[r(152)][r(201)][r(188)]();
126
+ }), globalThis[T(152)][T(201)].run());
81
127
  });
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);
128
+ } catch (h) {
129
+ console.error(d(154)), console[d(122)](h);
84
130
  }
85
131
  });
86
132
  }
87
- return s[e(260)]();
133
+ return l[x(187)]();
88
134
  });
89
135
  };
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();
136
+ function N() {
137
+ const e = ["mm -", `mm;
138
+ }
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>
141
+ .hiprint-printPanel-small{
142
+ box-sizing: border-box;
143
+ border: 0px;
144
+ }
145
+ .hiprint-printPaper-small{
146
+ position: relative;
147
+ padding: 0;
148
+ }
149
+ .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();
95
155
  }
96
- (function(r, n) {
97
- for (var x = y, e = r(); []; )
156
+ (function(e, n) {
157
+ for (var a = q, x = e(); []; )
98
158
  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)
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)
101
161
  break;
102
- e.push(e.shift());
103
- } catch (s) {
104
- e.push(e.shift());
162
+ x.push(x.shift());
163
+ } catch (l) {
164
+ x.push(x.shift());
105
165
  }
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);
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();
114
172
  }
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" };
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);
121
180
  }
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();
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" };
127
187
  }
128
188
  export {
129
- U as default
189
+ Y as default
130
190
  };
package/dist/index.umd.js CHANGED
@@ -1 +1,39 @@
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(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;
2
+ }
3
+ .hiprint-printTemplate .hiprint-printPanel-small {
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>
6
+ .hiprint-printPanel-small{
7
+ box-sizing: border-box;
8
+ border: 0px;
9
+ }
10
+ .hiprint-printPaper-small{
11
+ position: relative;
12
+ padding: 0;
13
+ }
14
+ .hiprint-printTemplate .hiprint-printPaper{
15
+ display: flex;
16
+ flex-wrap: wrap;
17
+ flex-direction: column;
18
+ align-content: flex-start;
19
+ margin: -`+(Number(i[x(141)])||0)/2+x(184)+(Number(i.layoutColumnGap)||0)/2+`mm;
20
+ }
21
+ .hiprint-printTemplate .hiprint-printPanel-small {
22
+ 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>
29
+ .hiprint-printPanel-small{
30
+ box-sizing: border-box;
31
+ border: 0px;
32
+ }
33
+ .hiprint-printPaper-small{
34
+ position: relative;
35
+ padding: 0;
36
+ }
37
+ .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});
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.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": "^2.5.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
  }