GWT:从html字符串生成图像(.png,jpeg)

GWT:从html字符串生成图像(.png,jpeg)

问题描述:

我有一个生成HTML字符串的GWT应用程序。我想将此String转换为图像,例如

I have a GWT app that generates an HTML String. I want to convert this String to an image e.g

<html>
 <head> </head>    
 <body>
  <several HTML elements including <img too>
 </body>
</html>

我试着使用

I tried to using Html2Image which works when I test it locally in a normal Java code (with a main class)

但是,当我部署到Google App Engine(GAE)时,我得到:

But when I deploy to Google App Engine (GAE) I get:

    java.lang.NoClassDefFoundError: java.awt.geom.Dimension2D is a restricted class.
 Please see the Google App Engine developer's guide for more details.
        at com.google.apphosting.runtime.security.shared.stub.java.awt.geom.Dimension2D.<clinit>(Dimension2D.java)
        at gui.ava.html.image.generator.HtmlImageGenerator.<clinit>(HtmlImageGenerator.java:26)
        at co.za.cre8.web.lottoShop.server.NotificationServiceImpl.geneateImage(NotificationServiceImpl.java:237)
        at co.za.cre8.web.lottoShop.server.NotificationServiceImpl.sendMessage(NotificationServiceImpl.java:181)

很清楚什么问题是,有没有其他库?

Pretty clear what the problem is, is there an alternative library?

在此先感谢。
PB

Thanks in advance. PB

转换API 会为您处理。