@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.
@@ -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,success,fileExtension,extension,type} = options;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@fto-consult/expo-ui",
3
- "version": "7.4.43",
3
+ "version": "7.4.44",
4
4
  "description": "Bibliothèque de composants UI Expo,react-native",
5
5
  "scripts": {
6
6
  "clear-npx-cache": "npx clear-npx-cache",
@@ -1,4 +1,12 @@
1
- export default function print(pdfMakeInstance,...rest){
2
- console.log("printint electron pdf make ",rest);
3
- return pdfMakeInstance.print(...rest);
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
  }
@@ -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() && ELECTRON.printPDF){
4
- return ELECTRON.printPDF(options);
4
+ if(isElectron()){
5
+ return electronPrint(pdfMakeInstance,options,...rest);
5
6
  }
6
7
  return pdfMakeInstance.print(options,...rest);
7
8
  }