Questions tagged [imgkit]

Library that allows JPG images to be created using plain HTML+CSS.

Create JPGs using plain old HTML+CSS. Uses wkhtmltoimage on the backend which renders HTML using Webkit.

Heavily based on PDFKit.

Homepage

57 questions
0
votes
1 answer

imgkit: get rid of extra padding on the right

Is there a way to get rid of extra padding on the right of the image after imgkit from_string method? You can see there is lot of white space on the right. Here is my code to do that . I am using to_html method to export chart with all script that…
shailesh gavathe
  • 341
  • 3
  • 10
0
votes
0 answers

Why imgkit in python convert HTML code to a blank image

Use imgkit to convert HTML to an image I am trying to convert html document embedded with Konva.js code to imgkit in python flask. Html code is working fine in browser. But I'm getting blank image in python. import imgkit # HTML code that contains…
0
votes
0 answers

Using imgkit to convert hindi content HTML to image

I am converting an HTML string HTML, CSS and JavaScript demo
ANURAG BISHT
  • 373
  • 3
  • 7
0
votes
0 answers

background image not display on convert html to image by IMGKit in rails

background image not display on convert html to image by IMGKit in rails html_file = render_to_string(:action => "generate_image", :layout => false) kit = IMGKit.new(html_file, :quality => 50) kit.stylesheets <<…
sunshine
  • 31
  • 2
0
votes
0 answers

python does not recognize no-background option in imgkit

I want to get an image of html elements with no background. this code below does it but it does adding white background. (I have images as elements there so I cant just remove the white background.): import imgkit kitoptions = { # some random…
Idan Rotbart
  • 93
  • 1
  • 5
0
votes
0 answers

Using Python and imgkit, the output is not as expected based on html rendered in browser

I am using imgkit and html/css to make tables containing data from a dataframe. The html/css I have looks as it should when rendered in a browser, but the image rendered by imgkit has horizontal gaps in row 3 and in the green background. imgkit…
Mary
  • 35
  • 5
0
votes
3 answers

Unable to convert imgkit image to PIL image

I am trying to convert an imgkit image into a PIL image to modify it. imgkit successfully converted the html to image when I tried to use a file. When I use BytesIO and try to convert to a PIL image, im getting an error. Here is my code: img =…
Ceres
  • 2,498
  • 1
  • 10
  • 28
0
votes
1 answer

How to convert html map into image (png or jpg )

I am trying to save a map containing markers and also heatmap into an image. Here is the code to display the map. from ipywidgets import Layout import geopandas defaultLayout=Layout(width='3000px', height='3000px') # A very large image. lat_lgn =…
Kyv
  • 615
  • 6
  • 26
0
votes
0 answers

Export styled pandas df with bar charts as png

I would like to export a pandas df with barcharts (https://pandas.pydata.org/pandas-docs/stable/user_guide/style.html#Bar-charts) using imgkit as follows but the barcharts are not included in the final pdf. I tried to pass the css separately to…
bjonen
  • 1,503
  • 16
  • 24
0
votes
1 answer

Image from html not rendered while converting it into JPG - IMGKit gem

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…
0
votes
2 answers

Python: converting an xml file to an image

I am looking to convert a xml file to an image (ideally a png file) using a python script. I have not found much from my online research. I am trying to use PIL. From this post on StackOverflow I was able to find this code: from PIL import…
Berti1989
  • 185
  • 1
  • 14
0
votes
0 answers

Border appears within image rather than around the image

So basically, I am trying to add a border to an image and screenshot it using img-kit via python3. I applied a border-radius and an actual border. However, the border appears inside the image, not around the object. Here's how it looks; I tried…
NekoTony
  • 54
  • 8
0
votes
1 answer

Having trouble witth imgkit

I am quite a noob when it comes to python. So there is probably quite a simple solution to this. I am trying to capture screenshots of webpages using imgkit. However, when running the script in pycharm, I keep getting this error: Traceback (most…
0
votes
1 answer

Trying to convert html to image using imgkit and wkhtmltoimage

Trying to convert the HTML content into image using ImgKit and wkhtmltoimage. Image is converted successfully but facing the issues with fonts (Font Awesome). The image is not look as it as HTML content. Attaching 2 images one which have HTML…
0
votes
2 answers

imgkit get height of image

what I'd like to do is very simple. I have a code which uses a imgkit library to load some webpage image and then stores it. It looks like that: kit = IMGKit.new(site, :quality => 5, :width => 1024) img = kit.to_img(:png) file =…
user2229608
  • 45
  • 1
  • 9