Module: Async::WebDriver::Scope::Printing

Included in:
Element, Async::WebDriver::Session
Defined in:
lib/async/webdriver/scope/printing.rb

Overview

Helpers for working with printing.

Instance Method Summary collapse

Instance Method Details

Print the current page and return the result as a Base64 encoded string containing a PDF representation of the paginated document.



14
15
16
17
18
# File 'lib/async/webdriver/scope/printing.rb', line 14

def print(page_ranges: nil, total_pages: nil)
	reply = session.post("print", {pageRanges: page_ranges, totalPages: total_pages}.compact)
	
	return Base64.decode64(reply["value"])
end