如何从包含 html 标签的字符串中渲染图像?
大家好,我有一个障碍,我希望有人能帮助我!我想从包含 html 标签的字符串生成图像:div、h1、img ...并应用 .css 样式。
可以用 php 来完成吗?
我想自动生成图像并将其存储在文件夹中,以便在页面上可视化它。 是否可以在页面加载期间生成?
图像示例:
也许还有其他方法来构建图像,我想知道。
例子: 假设我有以下 html 标签:
<div class="mybox">
<div class="mybox_title"> My Box </div>
<div class="imgbox"><img src="myimage.png" alt="myimage"></div>
</div>
我想将其转换为图像。
Hello everyone I have an obstacle, I hope someone can help me! I want to generate an image from the string which contains html tags: div, h1, img ... with .css styles applied.
Can it be done with php
I'd like to generate an image automaticaly and store in the folder in order to visualize it then on the page.
Is it possible to generate during the page load?
Example of the image:
Maybe there are othe ways to build the image, I'd like to know.
Example:
Suppose I have the following html tags:
<div class="mybox">
<div class="mybox_title"> My Box </div>
<div class="imgbox"><img src="myimage.png" alt="myimage"></div>
</div>
I'd like to convert it into image.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请看看 HTML2Canvas,它应该可以满足您的需求。
Please have a look at HTML2Canvas, which should fullfill your needs.