2

是否有某种方法可以使用 javascript 或嵌入式 Flash 对象等从浏览器发出屏幕捕获(仅限浏览器窗口内容),以便保存或打印页面内容的完整质量图像或替代方法。

我有一个带有谷歌地图和其他 ajax 操作客户端的网络应用程序(asp.net 3.5),如自定义图块服务器。我一直在尝试为用户实现一种打印高质量网页捕获的方法。

我使用了基本的 Window.Print(),但在 IE 和 FF 中,谷歌地图中有很多工件,并且弹出的气泡等一些项目不会打印。我已经尝试通过cutepdf保存pdf(只是在这里发布一个示例)并且通过window.print()的质量也很低。

例如,带有 FireShot 插件的屏幕截图是完美的,也是我希望客户拥有的。然而,这只是 FF,我不能要求客户在他们的浏览器上安装插件/activex 控件。

看看这个下载示例 zip 文件(4mb)

  1. 使用 FireShot 的示例屏幕截图(我想通过页面中的 html/JS 按钮实现的示例)
  2. Firefox Window.Print() 结果(cutepdf 用于保存为 pdf)
  3. IE Window.Print() 结果(可爱的pdf用来保存为pdf)

注意 2,3 中的小气泡即使打开也不会打印。

目前,我已经在我的网站上添加了全屏功能并引导用户截屏或调用 window.print() 函数。

我仍在寻找一种方法来打印/捕获我的页面。

是否有任何 flash/activex 控件可以包含在我的页面中并通过它们提供高质量的打印机制?

再次感谢所有帮助,但我仍然需要更多帮助。:)

先感谢您。

http://rapidshare.com/files/311849636/Print_examples.zip.html
4

5 回答 5

2

You'll go to all that work only to find that a simple app like Snagit will do the job. Building a SnagIt Screen Capture Plugin

于 2009-11-25T05:15:17.560 回答
1

The only way to reliably provide a high-quality print version of whats on-screen in a rich web application is to use the client-side, say JavaScript, to send the server precise information about the current state (where bubbles are, etc.) and use that to generate an image that mimics the positioning. Convert that image to a PDF or what-have-you, then send to the client for download.

于 2009-11-25T05:11:25.993 回答
1

Google also has a Static Maps API that might give you good results. I looked into it myself once, and only didn't go with it since (at the time) there were limitations on how many points they could support in a polyline.

于 2009-12-15T21:19:07.823 回答
0

我不认为这是可能的。能够通过脚本捕获用户的屏幕将是相当大的安全风险(想象不良站点捕获屏幕信息)。

于 2009-11-25T05:08:10.367 回答
0

No there is not, though it would come in quite handy at times for bug reporting etcetera.

You will probably get the best result by creating a separate version of the page as a PDF have that being generated. It's no quick fix by all means, but you'll get superb print quality and total control over everything. The map part will probably be a bit tricky though as you need to get the map as a bitmap on the server somehow, and if it's not in flash on the client I don't know how you'd do that.

于 2009-12-16T11:34:13.293 回答