将Html转换为可打印的图像 [英] Convert Html to a Printable Image
本文介绍了将Html转换为可打印的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个运行于.NET 2.0的项目。我的任务是将HTML中显示的数据重新创建为可打印的图像(分辨率至少为150dpi)。我看了几个选项,但没有用:
I am working on a project which runs on .NET 2.0. My task is to recreate the data displayed in HTML as a prinatable image (with the resolution of at least 150dpi). I looked into several options, to no avail:
- WebBrowser 类对象。将html呈现为图像时,它会使用服务器计算机上的屏幕分辨率。 Sciter 。它不公开可以设置输出图像分辨率的属性
- Awesomium 只能用于.NET 4.0或更高版本。
- The WebBrowser class object. While rendering html as an image, it uses the screen resolution on the server machine.
- The Sciter by Terra Informatica. It does not exposes a property with which one can set the resolution of the output image
- Awesomium can be used with .NET 4.0 or higher only.
我想知道是否有.NET库在那里可以将Html页面转换为可打印的图像。
任何帮助都非常感谢。
I wonder if there is a .NET library out there that can convert an Html page to a printable image. Any help is much appreciated.
推荐答案
通常的做法是将该页面生成为PDF服务器端允许用户下载并打印PDF。
The usual way to do this is to generate the page as a PDF server-side an allow the user to download and print the PDF.
这篇关于将Html转换为可打印的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文