@fto-consult/expo-ui 7.4.43 → 7.4.44
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/electron/preload.js +1 -1
- package/package.json +1 -1
- package/src/pdf/print.electron.js +11 -3
- package/src/pdf/print.web.js +3 -2
package/electron/preload.js
CHANGED
@@ -108,7 +108,7 @@ const createPDFFile = (options)=>{
|
|
108
108
|
return new Promise((resolve,reject)=>{
|
109
109
|
const dir = getPath("temp");
|
110
110
|
options = Object.assign({},options);
|
111
|
-
let {content,filename,fileName,charset,
|
111
|
+
let {content,filename,fileName,charset,fileExtension,extension} = options;
|
112
112
|
filename = defaultStr(filename,fileName)
|
113
113
|
if(isDataURL(content)){
|
114
114
|
content = isDataURL.toBase64(content);
|
package/package.json
CHANGED
@@ -1,4 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import {isElectron} from "$cplatform";
|
2
|
+
export default function print(pdfMakeInstance,options){
|
3
|
+
if(isElectron() && window?.ELECTRON && typeof window?.ELECTRON?.printPDF =='function'){
|
4
|
+
return pdfMakeInstance.getBase64((content)=>{
|
5
|
+
ELECTRON.printPDF({
|
6
|
+
...Object.assign({},options),
|
7
|
+
content,
|
8
|
+
})
|
9
|
+
})
|
10
|
+
}
|
11
|
+
return pdfMakeInstance.print();
|
4
12
|
}
|
package/src/pdf/print.web.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
import {isElectron} from "$cplatform";
|
2
|
+
import electronPrint from "./print.electron";
|
2
3
|
export default function print(pdfMakeInstance,options,...rest){
|
3
|
-
if(isElectron()
|
4
|
-
return
|
4
|
+
if(isElectron()){
|
5
|
+
return electronPrint(pdfMakeInstance,options,...rest);
|
5
6
|
}
|
6
7
|
return pdfMakeInstance.print(options,...rest);
|
7
8
|
}
|