gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 08:14:07 24 4
gpt4 key购买 nike

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

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

我尝试使用 Html2Image当我在普通 Java 代码(带有主类)中进行本地测试时,它可以工作

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

    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)

很清楚问题是什么,有替代库吗?

提前致谢。PB

最佳答案

conversion API将为您处理此事。

关于java - GWT:从 html 字符串生成图像(.png、jpeg),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10720409/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com