@fto-consult/expo-ui 7.4.45 → 7.4.47
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 +4 -4
- package/package.json +1 -1
package/electron/preload.js
CHANGED
@@ -130,10 +130,10 @@ const createPDFFile = (options)=>{
|
|
130
130
|
if(!fileName.endsWith(`.${fileExtension}`)){
|
131
131
|
fileName += "."+fileExtension
|
132
132
|
}
|
133
|
-
return fs.writeFile(
|
133
|
+
return fs.writeFile(path.join(dir,filename), content,{charset},(err)=>{
|
134
134
|
if(!err) {
|
135
135
|
const fileUrl = 'file://'+(dir+'/'+filename).replaceAll("\\","/");
|
136
|
-
const p =
|
136
|
+
const p = path.join(dir,filename);
|
137
137
|
const filePathUrl = 'file://'+p;
|
138
138
|
resolve({content,fileName:filename,filename,path:p,filePathUrl,filePathUri:filePathUrl,fileUrl,filePath:p,fileUri:fileUrl})
|
139
139
|
} else {
|
@@ -381,9 +381,9 @@ const ELECTRON = {
|
|
381
381
|
},
|
382
382
|
get printPDF (){
|
383
383
|
return (options)=>{
|
384
|
-
return createPDFFile(options).then(({path,filePathUrl})=>{
|
384
|
+
return createPDFFile(options).then(({path:mainPath,filePathUrl})=>{
|
385
385
|
const urlPath = path.resolve(__dirname,"pdf-viewer","viewer.html");
|
386
|
-
if(fs.existsSync(
|
386
|
+
if(fs.existsSync(mainPath)){
|
387
387
|
opts.loadURL = `file://${urlPath}?file=${decodeURIComponent(filePathUrl)}&locale=fr&fileName=${fileName}`;
|
388
388
|
opts.showOnLoad = true;
|
389
389
|
console.log("will print url ",options.loadURL,options);
|