我怎么能转换成一个DOM树成图像 [英] How can I convert a DOM Tree into an Image

查看:204
本文介绍了我怎么能转换成一个DOM树成图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,我有一个div中其中有一个有点复杂DOM树。它显示在大多数浏览器罚款(IE 6-8 FF 2.X-3.5.x的,浏览器,Safari浏览器),但是当我尝试打印我有一些跨浏览器的问题上,一些工作半部分时间和别人不工作的时候。

I'm have a web page where I have a div within which there is a somewhat complex DOM tree. It displays fine across most browsers(IE 6-8, FF 2.x-3.5.x, Chrome, Safari) but when I try to print the page I'm having some cross-browser problems, some work half some of the time and others don't work at all.

我的想法,如果我能得罪发送到服务器的DOM节点,解析出DOM树成图像,并有使用该图片在浏览器中打印,我想一举解决了这个问题。

I had the idea that if I could send offending the DOM nodes to the server, parse the DOM tree out into an image there and use that image to print in the browser, I'd solve this problem in one fell swoop.

有谁知道一个简单的方法来做到这一点?

Does anybody know of an easy way to do this?

我有正在运行Apache和mod_python的PHP和IIS 6运行.NET 2.0,所以我可以实现它的这些中的任何一个,真的没有preference对我而言:)

I've got apache running mod_python and PHP and IIS 6 running .NET 2.0 so I could implement it on either one of those, really no preference on my part :)

任何想法?

推荐答案

我已经使用这个C#code作为前获得网页截图的基础,它的工作真的很好。

I have used this C# code as a basis for getting screenshots of web pages before, and it worked really well.

网页thumbnailer的

这篇关于我怎么能转换成一个DOM树成图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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