@@ -46,6 +46,7 @@ const codeUrl = url.pathToFileURL(codeDir).href;
46
46
// Production app uses asar archive, so we need to go up two more level. It's extra cautious since asar is read-only anyway.
47
47
const appBaseDir = path . join ( __dirname , __dirname . endsWith ( path . join ( 'resources' , 'app.asar' , 'src' , 'main' ) ) ?
48
48
'/../../../../' : '/../../' ) ;
49
+ let appZoom = 1 ;
49
50
50
51
//Read config file
51
52
var queryObj = {
@@ -372,6 +373,8 @@ app.on('ready', e =>
372
373
'selects a page range (for PDF format only)' , argsRange )
373
374
. option ( '-u, --uncompressed' ,
374
375
'Uncompressed XML output (for XML format only)' )
376
+ . option ( '-z, --zoom <zoom>' ,
377
+ 'scales the application interface' , parseFloat )
375
378
. option ( '--enable-plugins' ,
376
379
'Enable Plugins' )
377
380
. parse ( argv )
@@ -385,6 +388,11 @@ app.on('ready', e =>
385
388
var options = program . opts ( ) ;
386
389
enablePlugins = options . enablePlugins ;
387
390
391
+ if ( options . zoom != null )
392
+ {
393
+ appZoom = options . zoom ;
394
+ }
395
+
388
396
//Start export mode?
389
397
if ( options . export )
390
398
{
@@ -755,8 +763,8 @@ app.on('ready', e =>
755
763
756
764
win . webContents . on ( 'did-finish-load' , function ( )
757
765
{
758
- win . webContents . zoomFactor = 1 ;
759
- win . webContents . setVisualZoomLevelLimits ( 1 , 1 ) ;
766
+ win . webContents . zoomFactor = appZoom ;
767
+ win . webContents . setVisualZoomLevelLimits ( 1 , appZoom ) ;
760
768
loadFinished ( ) ;
761
769
} ) ;
762
770
} )
@@ -799,8 +807,8 @@ app.on('ready', e =>
799
807
800
808
firstWinLoaded = true ;
801
809
802
- win . webContents . zoomFactor = 1 ;
803
- win . webContents . setVisualZoomLevelLimits ( 1 , 1 ) ;
810
+ win . webContents . zoomFactor = appZoom ;
811
+ win . webContents . setVisualZoomLevelLimits ( 1 , appZoom ) ;
804
812
loadFinished ( ) ;
805
813
} ) ;
806
814
@@ -986,8 +994,8 @@ app.on('will-finish-launching', function()
986
994
987
995
win . webContents . on ( 'did-finish-load' , function ( )
988
996
{
989
- win . webContents . zoomFactor = 1 ;
990
- win . webContents . setVisualZoomLevelLimits ( 1 , 1 ) ;
997
+ win . webContents . zoomFactor = appZoom ;
998
+ win . webContents . setVisualZoomLevelLimits ( 1 , appZoom ) ;
991
999
loadFinished ( ) ;
992
1000
} ) ;
993
1001
}
0 commit comments