I'm looking to set the "Fit All Columns on Page" print option via the Excel JavaScript API. It's very similar to this question which uses VBA -->
            Asked
            
        
        
            Active
            
        
            Viewed 321 times
        
    1 Answers
2
            The Office 365 Online Automate Scripts helped get me on the right path.
Docs:
Code:
await Excel.run(async (context) => {
    var ws = context.workbook.worksheets.getActiveWorksheet();
    var PageLayoutZoomOptions_Obj = {
        'horizontalFitToPages': 1,
        'verticalFitToPages': 0,
    }
    ws.pageLayout.zoom = PageLayoutZoomOptions_Obj
    await context.sync();
});
Note: I had issues using/including scale so I just left it out.
 
    
    
        E_net4
        
- 27,810
- 13
- 101
- 139
 
    
    
        FreeSoftwareServers
        
- 2,271
- 1
- 33
- 57