Manage the Ferrum browser instance
mainFerrumPdf manages a single Chrome browser instance per Ruby process. It is automatically created on the first use and is thread-safe within a single process.
Custom Browser: You can provide your own Ferrum::Browser instance to use instead of the auto-created one.
Shutdown: To shut down the current browser and allow the next call to create a new one, set FerrumPdf.browser = nil.
Per-call Browser: You can also pass a specific browser instance to an individual render call.
# Use a custom browser instance
custom_browser = Ferrum::Browser.new(window_size: [800, 600], headless: false)
FerrumPdf.browser = custom_browser
FerrumPdf.render_pdf(url: "https://example.org")
# Pass a browser to a single call
other_browser = Ferrum::Browser.new
FerrumPdf.render_pdf(url: "https://example.org", browser: other_browser)
# Shutdown current browser
FerrumPdf.browser = nil