I can't figure out what arguments to pass in to replicate this setting when I automatically print these pages in bulk using Selnium with ChromeDriver.
I've tried grep'ing through the Chromium source to figure this out... but no luck. Any ideas? Below is what my code looks like at the moment, with a bunch of failed attempts noted. Thank you!!!
appState = { "recentDestinations": [{
"id": "Save as PDF",
"origin": "local",
"account": "",
"printing.scaling": 'Custom', # <== Does it go here?
}],
"selectedDestinationId": "Save as PDF",
"version": 2,
"printing.scaling": 'Custom', # <== Or here?
}
profile = { 'printing.print_preview_sticky_settings.appState': json.dumps(appState),
'printing.print_header_footer': False,
# So many different versions of things I have tried :-(
'printing.scaling': 'Custom',
'printing.scaling_type': 'Custom',
'print_preview.scaling': 'Custom',
'print_preview.scaling_type': 'Custom',
'printing.custom_scaling': True,
'printing.fit_to_page_scaling': 50,
'printing.page_scaling': True,
}
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option('prefs', profile)
br = webdriver.Chrome(options=chrome_options)