I am using ChromeDriver 2.33 and am using kiosk printing to automatically click the Print button on the Print Preview dialog however it is sending the document to the printe
try adding Save as PDF
on recentDestinations
:
import json
settings = {
"appState": {
"recentDestinations": [{
"id": "Save as PDF",
"origin": "local"
}],
"selectedDestinationId": "Save as PDF",
"version": 2
}
}
prefs = {'printing.print_preview_sticky_settings': json.dumps(settings)}
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option('prefs', prefs)
chrome_options.add_argument('--kiosk-printing')
driver = webdriver.Chrome(chrome_options=chrome_options)