@@ -242,24 +242,24 @@ function printData (format, data, dataMan) {
242242 winPrint . webContents . printToPDF ( { marginsType : 1 , landscape : true , pageSize : { width : formats [ format ] . paper . height , height : formats [ format ] . paper . width } } , ( error , data ) => {
243243 if ( error ) throw error
244244 let fileName = formats [ format ] . name + '_' + new Date ( ) . getTime ( ) + '.pdf'
245- fs . writeFile ( './tmp/ ' + fileName , data , ( error ) => {
245+ fs . writeFile ( 'C:\\Export\\SignaturenDruck\\ ' + fileName , data , ( error ) => {
246246 if ( error ) throw error
247247 let ps = new Shell ( {
248248 executionPolicy : 'Bypass' ,
249249 noProfile : true
250250 } )
251251 if ( ! config . store . devMode ) {
252- ps . addCommand ( 'Start-Process "' + path . join ( __dirname , '.\\tmp\\ ' + fileName ) + '" -Verb PrintTo "' + formats [ format ] . printer + '" -PassThru | %{sleep 4;$_} | kill' )
252+ ps . addCommand ( 'Start-Process -file "' + 'C:\\Export\\SignaturenDruck\\ ' + fileName + '" -Verb PrintTo "' + formats [ format ] . printer + '" -PassThru | %{sleep 4;$_} | kill' )
253253 ps . invoke ( ) . then ( output => {
254- fs . unlinkSync ( path . join ( __dirname , '.\\tmp\\ ' + fileName ) )
254+ fs . unlinkSync ( 'C:\\Export\\SignaturenDruck\\ ' + fileName )
255255 mainWindow . webContents . send ( 'printMsg' , true )
256256 } ) . catch ( err => {
257257 electron . dialog . showErrorBox ( 'Es ist ein Fehler aufgetreten.' , err )
258258 mainWindow . webContents . send ( 'printMsg' , false )
259259 ps . dispose ( )
260260 } )
261261 } else {
262- ps . addCommand ( 'Start-Process "' + path . join ( __dirname , '.\\tmp\\ ' + fileName ) + '"' )
262+ ps . addCommand ( 'Start-Process -file "' + 'C:\\Export\\SignaturenDruck\\ ' + fileName + '"' )
263263 ps . invoke ( ) . then ( output => { mainWindow . webContents . send ( 'printMsg' , true ) ; ps . dispose ( ) } ) . catch ( err => {
264264 electron . dialog . showErrorBox ( 'Es ist ein Fehler aufgetreten.' , err )
265265 mainWindow . webContents . send ( 'printMsg' , false )
0 commit comments