How to get rid of the white border added by imgkit?

24 Views Asked by At

While using imgkit to convert html to jpg, I see a default white border (screenshot attached). I wanted to remove that white border, but I cannot seem to find a way.

After making the image I can always crop the border, but I was wondering if there is a way to not have that border in the first place? Any help will be appreciated. Thank you!

import io
import imgkit

html = '<div style="font-size: 80px; color: yellow; background-color: red">testing ...</div>'
options = {'enable-local-file-access': None}
f = io.StringIO(html)
imgkit.from_file(filename=f, output_path='test.jpg', options=options)

enter image description here

0

There are 0 best solutions below