Under More settings, chrome (v96) has an option for Margins, which I have selected as none. Here are our options currently for chrome:
Here are our options currently, which are set so that we can save PDFs locally with Selenium:
def make_options(output_dir):
state = {
"recentDestinations": [
{
"id": "Save as PDF",
"origin": "local",
"account": ""
}
],
"selectedDestinationId": "Save as PDF",
"version": 2
}
profile = {'printing.print_preview_sticky_settings.appState': json.dumps(state),
'savefile.default_directory': output_dir,
"download.default_directory": output_dir}
chrome_options = webdriver.ChromeOptions()
chrome_options.headless = False
chrome_options.add_experimental_option('prefs', profile)
chrome_options.add_argument('--kiosk-printing')
return chrome_options
I can see in the PDFs saved with Selenium that Margins
is not set to None
. Is it possible to update the code above for this? We need Margins: None
in the chrome options, setting it in the CSS of the webpage we are saving as PDF does not resolve our issue.