Print to PDF Question

Hi,

It’s not a keyword it’s chrome startup option. Found several issues on forums and all, but finally this worked for me :

${browser_prefs}    Create Dictionary     download.default_directory=_yourfolder      plugins.always_open_pdf_externally=${True}
${chrome_options}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
Call Method    ${chrome_options}    add_argument    --log-level\=3
Call Method    ${chrome_options}    add_experimental_option    prefs    ${browser_prefs}

Then Open Browser with options :

  Open Browser    url   chrome    options=${chrome_options}
  • Note : The -log-level is not necessary, it’s just an example if you have to add other arguments/options (gpu, sandbox…) to your ${chrome_options}.
  • Note : for yourfolder, depending of your OS you could use ${/} for path (have it working on Windows and Linux for example)

This will the PDF downloaded where it should normally open in a new tab.

Best Regards.

Charlie

2 Likes