GWT:从html字符串生成图像(.png,jpeg) [英] GWT: Generate image from html String (.png,jpeg)

查看:193
本文介绍了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 会为您处理。

这篇关于GWT:从html字符串生成图像(.png,jpeg)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆