web浏览器类 - 如何在不页眉/页脚打印文档?页眉、浏览器、文档、如何在

2023-09-03 06:11:48 作者:亡妃笑看土皇

我使用了 web浏览器类打开文档,变化值,保存和打印。现在的问题是,它打印文档,包括标题(第1页1)和页脚(文档+日根)

I'm using the WebBrowser class to open document, change values, save and print. The problem is, that it prints the document including the header("Page 1 of 1") and footer(root of the document + date)

我看了一下资料,并没有找到一种方法将其删除。它甚至有可能使用 web浏览器或者我应该寻找替代品?

I looked at the documentation and didn't find a way to remove them. Is it even possible using WebBrowser or should I look for alternatives?

推荐答案

有一个解决方案,可能不会因为清洁剂,因为它可能是。由于web浏览器inhertis它的设置从Internet Explorer,可以更改注册表中的值。幸运的是,值HKCU下,因此不需要管理权限。

There is a solution, probably not as cleaner as it could have been. Since WebBrowser inhertis it's settings from Internet Explorer it is possible to change the values in the registry. Luckily the values are under HKCU so no administration permissions are needed.

看看 http://stackoverflow.com/a/1321314/1630928