Since chrome 57 automatic PDF viewing no longer works as a plugin, there is now a setting that you can change to make this work. In fact, you can verify the prefix name by checking the chrome privilege dialog box in the "Content Settings" section, which says "Open PDF files in PDF application for viewing by default." 
You can set this value to false to avoid automatically previewing pdf, for example (Ruby example):
caps = Selenium::WebDriver::Remote::Capabilities.chrome( "chromeOptions" => { 'args' => ['disable-gpu', "--window-size=1920,1080"], prefs: { "download.prompt_for_download": false, "download.directory_upgrade": true, "plugins.always_open_pdf_externally": true, "download.default_directory": DownloadHelpers::PATH.to_s } } ) Capybara::Selenium::Driver.new( app, browser: :chrome, desired_capabilities: caps )
source share