gotenberg-ruby
gotenberg-ruby copied to clipboard
Extend with Screenshot
Hi there,
I wanted to use the screenshot capabilities of gotenberg and added a quickfix on my side.
Something like that would be really cool to use?
We would have to add some helper methods in the Gotenberg::Chromium::Chromium.
what do you think?
module Gotenberg
class Chromium::Screenshot < Gotenberg::Chromium
def call
backtrace if html_debug?
transform
self
end
def transform
properties['width'] = '720'
properties['format'] = 'webp'
@response = client.adapter.post('/forms/chromium/screenshot/url', properties.merge(files: files), headers).body
rescue StandardError => e
@exception = Gotenberg::TransformError.new(e)
end
end
end
Hi! Thanks a lot for the idea! I can’t give you any estimates for implementation right now, but I’ll keep as possible feature in mind.