123456789_123456789_123456789_123456789_123456789_

Module: Selenium::WebDriver::DriverExtensions::PrintsPage

Instance Method Summary

Instance Method Details

#save_print_page(path, **options)

Save a page as a PDF to the given path

Examples:

Save Printed Page

driver.save_print_page('../printed_page.pdf')

Parameters:

  • path (String)

    to where the pdf should be saved

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/driver_extensions/prints_page.rb', line 35

def save_print_page(path, **options)
  File.open(path, 'wb') do |file|
    content = Base64.decode64 print_page(**options)
    file << content
  end
end