You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to convert an HTML page into JPG image using IMGKit gem and wkhtmltoimage-binary, In my HTML page, there is a div class whose background is an image (styled inline), While converting this HTML page, the div background image is not rendered and remaining styles and contents are rendered in the generated image. I also tried IMG SRC tag in HTML, the image is not rendered if it's source is an url.
Looks like a wkhtmltopdf issue: wkhtmltopdf/wkhtmltopdf#2913
Unfortunately, wkhtmltopdf is not mantained anymore.
That said, I used the most recent workaround suggested in the issue and it worked for me:
I want to convert an HTML page into JPG image using IMGKit gem and wkhtmltoimage-binary, In my HTML page, there is a div class whose background is an image (styled inline), While converting this HTML page, the div background image is not rendered and remaining styles and contents are rendered in the generated image. I also tried IMG SRC tag in HTML, the image is not rendered if it's source is an url.
html = %Q[]
kit = IMGKit.new(html,:height => 300,:quality => 50)
img = kit.to_img
img = kit.to_img(:jpg)
file = kit.to_file('file.jpg')`
In the generated image, the img src is not rendered and it remains blank!
It could be great if anyone help me figure out how to use url in image src.
The text was updated successfully, but these errors were encountered: