Class: Bidi2pdfRails::Services::UrlToPdfConverter

Inherits:
Object
  • Object
show all
Includes:
Callbacks, PdfBrowserSession, PdfInjection
Defined in:
lib/bidi2pdf_rails/services/url_to_pdf_converter.rb

Instance Method Summary collapse

Methods included from Callbacks

#after_navigate, #after_print, #after_wait_for_tab, #before_navigate

Methods included from PdfInjection

#inject_custom_css, #inject_custom_js

Methods included from PdfBrowserSession

#run_browser_session

Constructor Details

#initialize(url, headers: {}, cookies: {}, auth: {}, print_options: {}, wait_for_network_idle: true, wait_for_page_loaded: true, wait_for_page_check_script: nil, custom_css: nil, custom_css_url: nil, custom_js: nil, custom_js_url: nil, callbacks: nil) ⇒ UrlToPdfConverter

Returns a new instance of UrlToPdfConverter.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/bidi2pdf_rails/services/url_to_pdf_converter.rb', line 10

def initialize(url, headers: {}, cookies: {}, auth: {}, print_options: {}, wait_for_network_idle: true, wait_for_page_loaded: true, wait_for_page_check_script: nil, custom_css: nil, custom_css_url: nil, custom_js: nil, custom_js_url: nil, callbacks: nil)
  @url = url
  @headers = headers || {}
  @cookies = cookies || {}
  @auth = auth || {}
  @print_options = print_options
  @wait_for_network_idle = wait_for_network_idle
  @wait_for_page_loaded = wait_for_page_loaded
  @wait_for_page_check_script = wait_for_page_check_script
  @custom_css = custom_css
  @custom_css_url = custom_css_url
  @custom_js = custom_js
  @custom_js_url = custom_js_url
  @callbacks = callbacks || {}
end

Instance Method Details

#generateObject



26
27
28
# File 'lib/bidi2pdf_rails/services/url_to_pdf_converter.rb', line 26

def generate
  run_browser_session
end