Converting HTML to image using java

前端 未结 3 1271
猫巷女王i
猫巷女王i 2020-12-30 17:09

i\'m facing some problem converting html to image using java im using html2image[java]

it create an image, but the problem is it only create an image on a small part

3条回答
  •  旧巷少年郎
    2020-12-30 18:03

    HtmlImageGenerator by default creates and sets a java.awt.Dimension object of (800,800). You can pass your own new Dimension(x, y) of your custom size using below setter of HtmlImageGenerator class:

     public void setSize(Dimension dimension);
    

    I hope it helps.

提交回复
热议问题