@sv-print/plugin-api-pdf3 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 _=(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 $=(n,a,e)=>new Promise((x,l)=>{var b=t=>{try{h(e.next(t))}catch(u){l(u)}},T=t=>{try{h(e.throw(t))}catch(u){l(u)}},h=t=>t.done?x(t.value):Promise.resolve(t.value).then(b,T);h((e=e.apply(n,a)).next())});const H=require("html-to-image"),W=require("jspdf");function B(n){if(n&&n.__esModule)return n;const a=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(a,e,x.get?x:{enumerable:!0,get:()=>n[e]})}}return a.default=n,Object.freeze(a)}const A=B(H);function N(){const n=["string",`mm;
2
+ }
3
+ .hiprint-printTemplate .hiprint-printPanel-small {
4
+ display:inline-block;
5
+ padding: `,'<div class="hiprint-printTemplate"></div>',"image/jpeg","217311dwUuKq","onProgress","clone","log","toPdf percent: ","save","toLowerCase","css","Deferred","hiprint-printPaper","each","toCanvas","svg","promise","getHtml","505125TmzeWp","row","webp","toLocaleLowerCase",".pdf","layoutRowGap","\u81EA\u5B9A\u4E49","panelLayoutOptions","baseURI","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","toDataURL",`mm;
6
+ }
7
+ </style>`,"png","add","getOrient",`mm;"></div>
8
+ </div>`,"imageSmoothingEnabled","html","4701KfnUJn","JPEG","toPt","1027902YSTdxD","mm -","22FBGRQd","blob","cur","layoutType","paperHeight","indexOf","removeTempContainer",`<div class="hiprint-printPanel">
9
+ <div class="hiprint-printPaper" style="width:`,"addPage","hiprint-printPaper-small start-",".hiprint-printPaper","loadAllImages","paperWidth","svg2canvas","hinnn","append","total","333410YIUmtd","height","sv-print-","gif","ceil","resolve","run",'<div class="hiprint-printPanel-small"></div>',"position:fixed","getContext","mm ","landscape","error","5NHjLEg","portrait","find","catch","then","output","496qDgPXn","createTempContainer","IMG","includes","addImage","quality","now","name","jpg","280QkzMMz","http","extend","jpeg",".hiprint-printPanel .hiprint-printPaper","671168WLjhUz","16877rUNkCS","printPanels","queue","src","width","removeClass","layoutColumnGap","floor"];return N=function(){return n},N()}(function(n,a){const e=G,x=n();for(;[];)try{if(-parseInt(e(179))/1+parseInt(e(166))/2+parseInt(e(212))/3*(-parseInt(e(161))/4)+parseInt(e(247))/5*(parseInt(e(215))/6)+-parseInt(e(167))/7*(-parseInt(e(152))/8)+-parseInt(e(194))/9+parseInt(e(234))/10*(-parseInt(e(217))/11)===a)break;x.push(x.shift())}catch(l){x.push(x.shift())}})(N,206575);const E=function(n,a,e){return $(this,null,function*(){const x=G;var l=this,b=globalThis.$[x(187)](),T=!![];let h=(g,P)=>{const d=x,o=Math[d(174)](g/P*100);console[d(182)](d(219),g,d(233),P),console[d(182)](d(183),o+"%")},t=e||{};if(this.printPanels.length){if(typeof a===x(175)){const r=a.indexOf(x(198))>-1?a:a+x(198);t[x(159)]=r}else t=a||{},!t[x(159)]&&(t[x(159)]=x(236)+Date[x(158)]()+".pdf");let g=this.printPanels[0][x(171)],P=this[x(168)][0][x(235)];var u=globalThis[x(231)].mm.toPt(t.paperWidth||g),z=globalThis[x(231)].mm[x(214)](t[x(221)]||P),w=globalThis.$[x(163)]({filter:r=>{const i=x;return r.tagName!=i(154)||r.tagName==i(154)&&([i(160),i(164),i(206),i(237),"bmp",i(196),i(191)][i(155)](r.src.split(".").pop()[i(185)]())||r[i(170)]!=r[i(202)]||r.src[i(222)](i(162))>-1&&r.src!=r[i(202)]||r[i(170)][i(222)]("base64")>-1)},backgroundColor:"#fff"},t||{});const d=this[x(168)][0].paperType,o=this[x(168)][0][x(201)],L=o&&(o[x(199)]>0||o[x(173)]>0),S=d!=null&&d!=""&&d!=x(200);var I=new W.jsPDF({orientation:this[x(208)](0)==1?x(248):x(245),unit:"pt",format:S?d[x(197)]():[u,z]}),m=yield this[x(193)](n,t);t&&t.isDownload!=null&&(T=t.isDownload),t&&t[x(180)]!=null&&(h=t[x(180)]),globalThis.$(m).css(x(171),"")[x(186)](x(235),""),this[x(153)]();var y=this.getTempContainer();if(L&&t[x(229)]&&t[x(221)]){let r=Math.floor(t[x(229)]/(g+o.layoutRowGap/2)),i=Math.floor(t.paperHeight/(P+o[x(173)]/2));const v=r*i,f=m[x(249)](".hiprint-printPanel .hiprint-printPaper"),_=f.length,s=Math[x(238)](_/v);let c=globalThis.$(x(177));o[x(220)]==x(195)?c[x(232)](`<style>
10
+ .hiprint-printPanel-small{
11
+ box-sizing: border-box;
12
+ border: 0px;
13
+ }
14
+ .hiprint-printPaper-small{
15
+ position: relative;
16
+ padding: 0;
17
+ }
18
+ .hiprint-printTemplate .hiprint-printPaper{
19
+ margin: -`+(Number(o[x(199)])||0)/2+x(216)+(Number(o[x(173)])||0)/2+x(176)+(Number(o[x(199)])||0)/2+x(244)+(Number(o.layoutColumnGap)||0)/2+x(205)):c[x(232)](`<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
+ display: flex;
30
+ flex-wrap: wrap;
31
+ flex-direction: column;
32
+ align-content: flex-start;
33
+ margin: -`+(Number(o[x(199)])||0)/2+x(216)+(Number(o[x(173)])||0)/2+x(176)+(Number(o[x(199)])||0)/2+x(244)+(Number(o[x(173)])||0)/2+x(205));for(let p=0;p<s;p++){const j=globalThis.$(x(224)+t[x(229)]+"mm;height:"+t[x(221)]+x(209)),O=p*v,U=Math.min((p+1)*v,_);for(let C=O;C<U;C++){const q=f.eq(C)[x(181)]();q[x(172)](x(188)),q.addClass(x(226)+C);const R=globalThis.$(x(241));R.append(q),j.find(x(227))[x(232)](R)}c[x(232)](j)}this[x(230)](c,w),y[x(211)](c[0]),globalThis.$(c)[x(186)](x(242))}else this[x(230)](m,w),y[x(211)](m[0]),globalThis.$(m)[x(186)]("position:fixed");let k=y.find(x(165)).length;this[x(228)](m,function(){const r=x;try{y[r(249)](".hiprint-printPanel .hiprint-printPaper")[r(189)](function(i,v){const f=r;globalThis.hinnn[f(169)][f(207)](function(_){const s=f;A[s(190)](v,w)[s(251)](function(c){const p=s;var j=c[p(243)]("2d");j[p(210)]=![];var O=c[p(204)](p(178),w[p(157)]||.92);I[p(156)](O,p(213),0,0,u,z),i<k-1&&I[p(225)](),h(i+1,k),_()})[s(250)](c=>{throw new Error(c.message)})}),i==k-1&&(globalThis[f(231)].queue.add(function(_){const s=f;if(T)l[s(223)](),I[s(184)](t[s(159)]);else{l[s(223)]();let c=t.type||s(218),p=I[s(151)](c);b[s(239)](p)}globalThis[s(231)][s(169)].clear()}),globalThis.hinnn[f(169)][f(240)]())})}catch(i){console[r(246)](r(203)),console[r(182)](i)}})}return b[x(192)]()})};function G(n,a){const e=N();return G=function(x,l){return x=x-151,e[x]},G(n,a)}function D(){var n=["5901KchWZA","10ZGmwvo","3104580mbrHuz","1044784GSXpCG","2352swQRTp","200559RKXpcB","385016BwJDBh","10XMnmGk","add toPdf Api","5cDVaPw","0.3.0","3357657ujxRWf","defineProperty","11517473BxFqSG","add toPdf Api to PrintTemplate"];return D=function(){return n},D()}(function(n,a){for(var e=M,x=n();[];)try{var l=parseInt(e(217))/1+-parseInt(e(212))/2*(-parseInt(e(216))/3)+-parseInt(e(214))/4*(-parseInt(e(220))/5)+parseInt(e(213))/6+-parseInt(e(211))/7*(-parseInt(e(215))/8)+-parseInt(e(222))/9+parseInt(e(218))/10*(-parseInt(e(224))/11);if(l===a)break;x.push(x.shift())}catch(b){x.push(x.shift())}})(D,325633);function M(n,a){var e=D();return M=function(x,l){x=x-210;var b=e[x];return b},M(n,a)}function K(n){var a=M;return{name:a(219),description:a(219),hooks:[{hook:"newPrintTemplate",name:a(210),description:a(210),priority:1,run:({template:e,options:x})=>{var l=a;Object[l(223)](e,"toPdf",{value:E,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:a(221)}}module.exports=K;
package/dist/index.mjs CHANGED
@@ -1,130 +1,186 @@
1
- var k = (r, a, t) => new Promise((x, o) => {
2
- var s = (p) => {
1
+ var L = (r, n, e) => new Promise((x, l) => {
2
+ var h = (a) => {
3
3
  try {
4
- d(t.next(p));
5
- } catch (u) {
6
- o(u);
4
+ b(e.next(a));
5
+ } catch (m) {
6
+ l(m);
7
7
  }
8
- }, b = (p) => {
8
+ }, T = (a) => {
9
9
  try {
10
- d(t.throw(p));
11
- } catch (u) {
12
- o(u);
10
+ b(e.throw(a));
11
+ } catch (m) {
12
+ l(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
+ }, b = (a) => a.done ? x(a.value) : Promise.resolve(a.value).then(h, T);
15
+ b((e = e.apply(r, n)).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 * as B from "html-to-image";
18
+ import { jsPDF as O } from "jspdf";
19
+ function N() {
20
+ const r = ["string", `mm;
21
+ }
22
+ .hiprint-printTemplate .hiprint-printPanel-small {
23
+ display:inline-block;
24
+ padding: `, '<div class="hiprint-printTemplate"></div>', "image/jpeg", "217311dwUuKq", "onProgress", "clone", "log", "toPdf percent: ", "save", "toLowerCase", "css", "Deferred", "hiprint-printPaper", "each", "toCanvas", "svg", "promise", "getHtml", "505125TmzeWp", "row", "webp", "toLocaleLowerCase", ".pdf", "layoutRowGap", "\u81EA\u5B9A\u4E49", "panelLayoutOptions", "baseURI", "toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ", "toDataURL", `mm;
25
+ }
26
+ </style>`, "png", "add", "getOrient", `mm;"></div>
27
+ </div>`, "imageSmoothingEnabled", "html", "4701KfnUJn", "JPEG", "toPt", "1027902YSTdxD", "mm -", "22FBGRQd", "blob", "cur", "layoutType", "paperHeight", "indexOf", "removeTempContainer", `<div class="hiprint-printPanel">
28
+ <div class="hiprint-printPaper" style="width:`, "addPage", "hiprint-printPaper-small start-", ".hiprint-printPaper", "loadAllImages", "paperWidth", "svg2canvas", "hinnn", "append", "total", "333410YIUmtd", "height", "sv-print-", "gif", "ceil", "resolve", "run", '<div class="hiprint-printPanel-small"></div>', "position:fixed", "getContext", "mm ", "landscape", "error", "5NHjLEg", "portrait", "find", "catch", "then", "output", "496qDgPXn", "createTempContainer", "IMG", "includes", "addImage", "quality", "now", "name", "jpg", "280QkzMMz", "http", "extend", "jpeg", ".hiprint-printPanel .hiprint-printPaper", "671168WLjhUz", "16877rUNkCS", "printPanels", "queue", "src", "width", "removeClass", "layoutColumnGap", "floor"];
29
+ return N = function() {
30
+ return r;
31
+ }, N();
32
+ }
33
+ (function(r, n) {
34
+ const e = D, x = r();
35
+ for (; []; )
21
36
  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)
37
+ if (-parseInt(e(179)) / 1 + parseInt(e(166)) / 2 + parseInt(e(212)) / 3 * (-parseInt(e(161)) / 4) + parseInt(e(247)) / 5 * (parseInt(e(215)) / 6) + -parseInt(e(167)) / 7 * (-parseInt(e(152)) / 8) + -parseInt(e(194)) / 9 + parseInt(e(234)) / 10 * (-parseInt(e(217)) / 11) === n)
24
38
  break;
25
39
  x.push(x.shift());
26
- } catch (s) {
40
+ } catch (l) {
27
41
  x.push(x.shift());
28
42
  }
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
- };
43
+ })(N, 206575);
44
+ const S = function(r, n, e) {
45
+ return L(this, null, function* () {
46
+ const x = D;
47
+ var l = this, h = globalThis.$[x(187)](), T = !![];
48
+ let b = (g, P) => {
49
+ const d = x, o = Math[d(174)](g / P * 100);
50
+ console[d(182)](d(219), g, d(233), P), console[d(182)](d(183), o + "%");
51
+ }, a = e || {};
52
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;
53
+ if (typeof n === x(175)) {
54
+ const i = n.indexOf(x(198)) > -1 ? n : n + x(198);
55
+ a[x(159)] = i;
56
+ } else
57
+ a = n || {}, !a[x(159)] && (a[x(159)] = x(236) + Date[x(158)]() + ".pdf");
58
+ let g = this.printPanels[0][x(171)], P = this[x(168)][0][x(235)];
59
+ var m = globalThis[x(231)].mm.toPt(a.paperWidth || g), q = globalThis[x(231)].mm[x(214)](a[x(221)] || P), I = globalThis.$[x(163)]({ filter: (i) => {
60
+ const t = x;
61
+ return i.tagName != t(154) || i.tagName == t(154) && ([t(160), t(164), t(206), t(237), "bmp", t(196), t(191)][t(155)](i.src.split(".").pop()[t(185)]()) || i[t(170)] != i[t(202)] || i.src[t(222)](t(162)) > -1 && i.src != i[t(202)] || i[t(170)][t(222)]("base64") > -1);
62
+ }, backgroundColor: "#fff" }, a || {});
63
+ const d = this[x(168)][0].paperType, o = this[x(168)][0][x(201)], U = o && (o[x(199)] > 0 || o[x(173)] > 0), H = d != null && d != "" && d != x(200);
64
+ var w = new O({ orientation: this[x(208)](0) == 1 ? x(248) : x(245), unit: "pt", format: H ? d[x(197)]() : [m, q] }), u = yield this[x(193)](r, a);
65
+ a && a.isDownload != null && (T = a.isDownload), a && a[x(180)] != null && (b = a[x(180)]), globalThis.$(u).css(x(171), "")[x(186)](x(235), ""), this[x(153)]();
66
+ var y = this.getTempContainer();
67
+ if (U && a[x(229)] && a[x(221)]) {
68
+ let i = Math.floor(a[x(229)] / (g + o.layoutRowGap / 2)), t = Math.floor(a.paperHeight / (P + o[x(173)] / 2));
69
+ const v = i * t, f = u[x(249)](".hiprint-printPanel .hiprint-printPaper"), _ = f.length, p = Math[x(238)](_ / v);
70
+ let c = globalThis.$(x(177));
71
+ o[x(220)] == x(195) ? c[x(232)](`<style>
72
+ .hiprint-printPanel-small{
73
+ box-sizing: border-box;
74
+ border: 0px;
75
+ }
76
+ .hiprint-printPaper-small{
77
+ position: relative;
78
+ padding: 0;
79
+ }
80
+ .hiprint-printTemplate .hiprint-printPaper{
81
+ margin: -` + (Number(o[x(199)]) || 0) / 2 + x(216) + (Number(o[x(173)]) || 0) / 2 + x(176) + (Number(o[x(199)]) || 0) / 2 + x(244) + (Number(o.layoutColumnGap) || 0) / 2 + x(205)) : c[x(232)](`<style>
82
+ .hiprint-printPanel-small{
83
+ box-sizing: border-box;
84
+ border: 0px;
85
+ }
86
+ .hiprint-printPaper-small{
87
+ position: relative;
88
+ padding: 0;
89
+ }
90
+ .hiprint-printTemplate .hiprint-printPaper{
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ flex-direction: column;
94
+ align-content: flex-start;
95
+ margin: -` + (Number(o[x(199)]) || 0) / 2 + x(216) + (Number(o[x(173)]) || 0) / 2 + x(176) + (Number(o[x(199)]) || 0) / 2 + x(244) + (Number(o[x(173)]) || 0) / 2 + x(205));
96
+ for (let s = 0; s < p; s++) {
97
+ const C = globalThis.$(x(224) + a[x(229)] + "mm;height:" + a[x(221)] + x(209)), R = s * v, W = Math.min((s + 1) * v, _);
98
+ for (let G = R; G < W; G++) {
99
+ const $ = f.eq(G)[x(181)]();
100
+ $[x(172)](x(188)), $.addClass(x(226) + G);
101
+ const z = globalThis.$(x(241));
102
+ z.append($), C.find(x(227))[x(232)](z);
103
+ }
104
+ c[x(232)](C);
105
+ }
106
+ this[x(230)](c, I), y[x(211)](c[0]), globalThis.$(c)[x(186)](x(242));
107
+ } else
108
+ this[x(230)](u, I), y[x(211)](u[0]), globalThis.$(u)[x(186)]("position:fixed");
109
+ let j = y.find(x(165)).length;
110
+ this[x(228)](u, function() {
111
+ const i = x;
65
112
  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();
113
+ y[i(249)](".hiprint-printPanel .hiprint-printPaper")[i(189)](function(t, v) {
114
+ const f = i;
115
+ globalThis.hinnn[f(169)][f(207)](function(_) {
116
+ const p = f;
117
+ B[p(190)](v, I)[p(251)](function(c) {
118
+ const s = p;
119
+ var C = c[s(243)]("2d");
120
+ C[s(210)] = ![];
121
+ var R = c[s(204)](s(178), I[s(157)] || 0.92);
122
+ w[s(156)](R, s(213), 0, 0, m, q), t < j - 1 && w[s(225)](), b(t + 1, j), _();
123
+ })[p(250)]((c) => {
124
+ throw new Error(c.message);
75
125
  });
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));
126
+ }), t == j - 1 && (globalThis[f(231)].queue.add(function(_) {
127
+ const p = f;
128
+ if (T)
129
+ l[p(223)](), w[p(184)](a[p(159)]);
80
130
  else {
81
- o[i(356)]();
82
- let P = t[i(348)] || i(343), l = g[i(333)](P);
83
- s[i(304)](l);
131
+ l[p(223)]();
132
+ let c = a.type || p(218), s = w[p(151)](c);
133
+ h[p(239)](s);
84
134
  }
85
- globalThis[i(353)].queue[i(336)]();
86
- }), globalThis.hinnn[c(313)].run());
135
+ globalThis[p(231)][p(169)].clear();
136
+ }), globalThis.hinnn[f(169)][f(240)]());
87
137
  });
88
- } catch (e) {
89
- console[n(299)](n(361)), console[n(334)](e);
138
+ } catch (t) {
139
+ console[i(246)](i(203)), console[i(182)](t);
90
140
  }
91
141
  });
92
142
  }
93
- return s[x(337)]();
143
+ return h[x(192)]();
94
144
  });
95
145
  };
96
- (function(r, a) {
97
- for (var t = w, x = r(); []; )
146
+ function D(r, n) {
147
+ const e = N();
148
+ return D = function(x, l) {
149
+ return x = x - 151, e[x];
150
+ }, D(r, n);
151
+ }
152
+ function k() {
153
+ var r = ["5901KchWZA", "10ZGmwvo", "3104580mbrHuz", "1044784GSXpCG", "2352swQRTp", "200559RKXpcB", "385016BwJDBh", "10XMnmGk", "add toPdf Api", "5cDVaPw", "0.3.0", "3357657ujxRWf", "defineProperty", "11517473BxFqSG", "add toPdf Api to PrintTemplate"];
154
+ return k = function() {
155
+ return r;
156
+ }, k();
157
+ }
158
+ (function(r, n) {
159
+ for (var e = M, x = r(); []; )
98
160
  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);
100
- if (o === a)
161
+ var l = parseInt(e(217)) / 1 + -parseInt(e(212)) / 2 * (-parseInt(e(216)) / 3) + -parseInt(e(214)) / 4 * (-parseInt(e(220)) / 5) + parseInt(e(213)) / 6 + -parseInt(e(211)) / 7 * (-parseInt(e(215)) / 8) + -parseInt(e(222)) / 9 + parseInt(e(218)) / 10 * (-parseInt(e(224)) / 11);
162
+ if (l === n)
101
163
  break;
102
164
  x.push(x.shift());
103
- } catch (s) {
165
+ } catch (h) {
104
166
  x.push(x.shift());
105
167
  }
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);
168
+ })(k, 325633);
169
+ function M(r, n) {
170
+ var e = k();
171
+ return M = function(x, l) {
172
+ x = x - 210;
173
+ var h = e[x];
174
+ return h;
175
+ }, M(r, n);
114
176
  }
115
- function N(r) {
116
- var a = w;
117
- return { name: a(283), description: "add toPdf Api", hooks: [{ hook: a(285), name: a(282), description: "add toPdf Api to PrintTemplate", priority: 1, run: ({ template: t, options: x }) => {
118
- var o = a;
119
- Object[o(284)](t, o(290), { value: H, enumerable: ![], writable: !![], configurable: !![] });
120
- } }], leastHiprintVersion: "0.3.0" };
121
- }
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();
177
+ function K(r) {
178
+ var n = M;
179
+ return { name: n(219), description: n(219), hooks: [{ hook: "newPrintTemplate", name: n(210), description: n(210), priority: 1, run: ({ template: e, options: x }) => {
180
+ var l = n;
181
+ Object[l(223)](e, "toPdf", { value: S, enumerable: ![], writable: !![], configurable: !![] });
182
+ } }], leastHiprintVersion: n(221) };
127
183
  }
128
184
  export {
129
- N as default
185
+ K as default
130
186
  };
package/dist/index.umd.js CHANGED
@@ -1 +1,33 @@
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(b,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m(require("html-to-image"),require("jspdf")):typeof define=="function"&&define.amd?define(["html-to-image","jspdf"],m):(b=typeof globalThis!="undefined"?globalThis:b||self,b.pluginApiPdf=m(b.htmlToImage,b.jspdf))})(this,function(b,m){"use strict";var A=(b,m,P)=>new Promise((O,g)=>{var q=c=>{try{u(P.next(c))}catch(y){g(y)}},v=c=>{try{u(P.throw(c))}catch(y){g(y)}},u=c=>c.done?O(c.value):Promise.resolve(c.value).then(q,v);u((P=P.apply(b,m)).next())});function P(n){if(n&&n.__esModule)return n;const a=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(a,e,x.get?x:{enumerable:!0,get:()=>n[e]})}}return a.default=n,Object.freeze(a)}const O=P(b);function g(){const n=["string",`mm;
2
+ }
3
+ .hiprint-printTemplate .hiprint-printPanel-small {
4
+ display:inline-block;
5
+ padding: `,'<div class="hiprint-printTemplate"></div>',"image/jpeg","217311dwUuKq","onProgress","clone","log","toPdf percent: ","save","toLowerCase","css","Deferred","hiprint-printPaper","each","toCanvas","svg","promise","getHtml","505125TmzeWp","row","webp","toLocaleLowerCase",".pdf","layoutRowGap","\u81EA\u5B9A\u4E49","panelLayoutOptions","baseURI","toPdf \u5931\u8D25(\u53EF\u80FD\u60A8\u7684\u56FE\u7247\u8D44\u6E90\u65E0\u6CD5\u6B63\u5E38\u52A0\u8F7D): ","toDataURL",`mm;
6
+ }
7
+ </style>`,"png","add","getOrient",`mm;"></div>
8
+ </div>`,"imageSmoothingEnabled","html","4701KfnUJn","JPEG","toPt","1027902YSTdxD","mm -","22FBGRQd","blob","cur","layoutType","paperHeight","indexOf","removeTempContainer",`<div class="hiprint-printPanel">
9
+ <div class="hiprint-printPaper" style="width:`,"addPage","hiprint-printPaper-small start-",".hiprint-printPaper","loadAllImages","paperWidth","svg2canvas","hinnn","append","total","333410YIUmtd","height","sv-print-","gif","ceil","resolve","run",'<div class="hiprint-printPanel-small"></div>',"position:fixed","getContext","mm ","landscape","error","5NHjLEg","portrait","find","catch","then","output","496qDgPXn","createTempContainer","IMG","includes","addImage","quality","now","name","jpg","280QkzMMz","http","extend","jpeg",".hiprint-printPanel .hiprint-printPaper","671168WLjhUz","16877rUNkCS","printPanels","queue","src","width","removeClass","layoutColumnGap","floor"];return g=function(){return n},g()}(function(n,a){const e=v,x=n();for(;[];)try{if(-parseInt(e(179))/1+parseInt(e(166))/2+parseInt(e(212))/3*(-parseInt(e(161))/4)+parseInt(e(247))/5*(parseInt(e(215))/6)+-parseInt(e(167))/7*(-parseInt(e(152))/8)+-parseInt(e(194))/9+parseInt(e(234))/10*(-parseInt(e(217))/11)===a)break;x.push(x.shift())}catch(f){x.push(x.shift())}})(g,206575);const q=function(n,a,e){return A(this,null,function*(){const x=v;var f=this,_=globalThis.$[x(187)](),L=!![];let S=(I,w)=>{const d=x,o=Math[d(174)](I/w*100);console[d(182)](d(219),I,d(233),w),console[d(182)](d(183),o+"%")},i=e||{};if(this.printPanels.length){if(typeof a===x(175)){const r=a.indexOf(x(198))>-1?a:a+x(198);i[x(159)]=r}else i=a||{},!i[x(159)]&&(i[x(159)]=x(236)+Date[x(158)]()+".pdf");let I=this.printPanels[0][x(171)],w=this[x(168)][0][x(235)];var U=globalThis[x(231)].mm.toPt(i.paperWidth||I),H=globalThis[x(231)].mm[x(214)](i[x(221)]||w),N=globalThis.$[x(163)]({filter:r=>{const t=x;return r.tagName!=t(154)||r.tagName==t(154)&&([t(160),t(164),t(206),t(237),"bmp",t(196),t(191)][t(155)](r.src.split(".").pop()[t(185)]())||r[t(170)]!=r[t(202)]||r.src[t(222)](t(162))>-1&&r.src!=r[t(202)]||r[t(170)][t(222)]("base64")>-1)},backgroundColor:"#fff"},i||{});const d=this[x(168)][0].paperType,o=this[x(168)][0][x(201)],B=o&&(o[x(199)]>0||o[x(173)]>0),E=d!=null&&d!=""&&d!=x(200);var G=new m.jsPDF({orientation:this[x(208)](0)==1?x(248):x(245),unit:"pt",format:E?d[x(197)]():[U,H]}),T=yield this[x(193)](n,i);i&&i.isDownload!=null&&(L=i.isDownload),i&&i[x(180)]!=null&&(S=i[x(180)]),globalThis.$(T).css(x(171),"")[x(186)](x(235),""),this[x(153)]();var D=this.getTempContainer();if(B&&i[x(229)]&&i[x(221)]){let r=Math.floor(i[x(229)]/(I+o.layoutRowGap/2)),t=Math.floor(i.paperHeight/(w+o[x(173)]/2));const j=r*t,h=T[x(249)](".hiprint-printPanel .hiprint-printPaper"),C=h.length,p=Math[x(238)](C/j);let l=globalThis.$(x(177));o[x(220)]==x(195)?l[x(232)](`<style>
10
+ .hiprint-printPanel-small{
11
+ box-sizing: border-box;
12
+ border: 0px;
13
+ }
14
+ .hiprint-printPaper-small{
15
+ position: relative;
16
+ padding: 0;
17
+ }
18
+ .hiprint-printTemplate .hiprint-printPaper{
19
+ margin: -`+(Number(o[x(199)])||0)/2+x(216)+(Number(o[x(173)])||0)/2+x(176)+(Number(o[x(199)])||0)/2+x(244)+(Number(o.layoutColumnGap)||0)/2+x(205)):l[x(232)](`<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
+ display: flex;
30
+ flex-wrap: wrap;
31
+ flex-direction: column;
32
+ align-content: flex-start;
33
+ margin: -`+(Number(o[x(199)])||0)/2+x(216)+(Number(o[x(173)])||0)/2+x(176)+(Number(o[x(199)])||0)/2+x(244)+(Number(o[x(173)])||0)/2+x(205));for(let s=0;s<p;s++){const M=globalThis.$(x(224)+i[x(229)]+"mm;height:"+i[x(221)]+x(209)),R=s*j,K=Math.min((s+1)*j,C);for(let k=R;k<K;k++){const $=h.eq(k)[x(181)]();$[x(172)](x(188)),$.addClass(x(226)+k);const W=globalThis.$(x(241));W.append($),M.find(x(227))[x(232)](W)}l[x(232)](M)}this[x(230)](l,N),D[x(211)](l[0]),globalThis.$(l)[x(186)](x(242))}else this[x(230)](T,N),D[x(211)](T[0]),globalThis.$(T)[x(186)]("position:fixed");let z=D.find(x(165)).length;this[x(228)](T,function(){const r=x;try{D[r(249)](".hiprint-printPanel .hiprint-printPaper")[r(189)](function(t,j){const h=r;globalThis.hinnn[h(169)][h(207)](function(C){const p=h;O[p(190)](j,N)[p(251)](function(l){const s=p;var M=l[s(243)]("2d");M[s(210)]=![];var R=l[s(204)](s(178),N[s(157)]||.92);G[s(156)](R,s(213),0,0,U,H),t<z-1&&G[s(225)](),S(t+1,z),C()})[p(250)](l=>{throw new Error(l.message)})}),t==z-1&&(globalThis[h(231)].queue.add(function(C){const p=h;if(L)f[p(223)](),G[p(184)](i[p(159)]);else{f[p(223)]();let l=i.type||p(218),s=G[p(151)](l);_[p(239)](s)}globalThis[p(231)][p(169)].clear()}),globalThis.hinnn[h(169)][h(240)]())})}catch(t){console[r(246)](r(203)),console[r(182)](t)}})}return _[x(192)]()})};function v(n,a){const e=g();return v=function(x,f){return x=x-151,e[x]},v(n,a)}function u(){var n=["5901KchWZA","10ZGmwvo","3104580mbrHuz","1044784GSXpCG","2352swQRTp","200559RKXpcB","385016BwJDBh","10XMnmGk","add toPdf Api","5cDVaPw","0.3.0","3357657ujxRWf","defineProperty","11517473BxFqSG","add toPdf Api to PrintTemplate"];return u=function(){return n},u()}(function(n,a){for(var e=c,x=n();[];)try{var f=parseInt(e(217))/1+-parseInt(e(212))/2*(-parseInt(e(216))/3)+-parseInt(e(214))/4*(-parseInt(e(220))/5)+parseInt(e(213))/6+-parseInt(e(211))/7*(-parseInt(e(215))/8)+-parseInt(e(222))/9+parseInt(e(218))/10*(-parseInt(e(224))/11);if(f===a)break;x.push(x.shift())}catch(_){x.push(x.shift())}})(u,325633);function c(n,a){var e=u();return c=function(x,f){x=x-210;var _=e[x];return _},c(n,a)}function y(n){var a=c;return{name:a(219),description:a(219),hooks:[{hook:"newPrintTemplate",name:a(210),description:a(210),priority:1,run:({template:e,options:x})=>{var f=a;Object[f(223)](e,"toPdf",{value:q,enumerable:![],writable:!![],configurable:!![]})}}],leastHiprintVersion:a(221)}}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-pdf3",
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",