Closed davidwessman closed 2 years ago
Hello.
I read through the documentation and the options for Ferrum::Browser.new but could not find any way to load a browser from a local file or string instead of an url.
Ferrum::Browser.new
The use-case I have is to render PDFs where there is no URL to load the HTML from.
html = generate_html browser = Ferrum::Browser.new browser.load(html) tmp = Tempfile.new("pdf-chrome-#{filename}") browser.pdf( path: tmp.path, format: :A4, landscape: false, margin: {top: 36, right: 36, bottom: 36, left: 36}, preferCSSPageSize: true, printBackground: true ) browser.quit pdf_data = File.read(tmp.path)
I am sorry if I missed some option for this, thankful for any help 🙂
Hello.
I read through the documentation and the options for
Ferrum::Browser.new
but could not find any way to load a browser from a local file or string instead of an url.The use-case I have is to render PDFs where there is no URL to load the HTML from.
I am sorry if I missed some option for this, thankful for any help 🙂