在打印之前更改Word文档的DPI [英] Changing DPI of the Word Document before Printing

查看:310
本文介绍了在打印之前更改Word文档的DPI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做的事情:

我正在尝试打印一个文档使用

I am trying to print a document using

WordDocument.PrintOut(...);

WordDocument.PrintOut(...);

注意:..替换所需的参数

Note: .. replaces desired parameters

WordDocument是
Microsoft.Office.Interop的实例.Word.Document。

WordDocument is instance of Microsoft.Office.Interop.Word.Document.

问题:

我必须打印具有特定DPI值的文档由用户提供。我没有找到将DPI值与打印输出方法或文档本身相关联的位置。

我发现param  PrintZoomPaperWidth
和  PrintZoomPaperWidth
但无法找到其值如何影响DPI。不确定是否可以。

I found param PrintZoomPaperWidth and PrintZoomPaperWidth but unable to find how its value can affect DPI. Not sure if it can.

是否有可用的代码可以在文档打印前更改DPI值?

Is there any code available that can change DPI value prior to document print?

关心Kumar Gaurav。

Regards Kumar Gaurav.

推荐答案

没有此属性为文档的DPI值。例如,所有字体都使用矢量化而不是位图,因此没有DPI值。只有插入的位图图像才会有DPI值,并且如果Word无法控制插入它们的
,那么你可以做的唯一一件事就是允许Word压缩它们,将根据所选的压缩选项给出220DPI或96DPI输出。您唯一的其他选择是更改打印机的
DPI设置,但执行此操作的代码(如果打印机支持)将是特定于打印机的。
There is no such property as a DPI value for a document. All the fonts, for example, use vectoring, not bitmaps, and thus have no DPI value. Only inserted bitmap images would have a DPI value and given that Word has no control over the PPI with which they were inserted, the only thing you can do to exercise any form of control is to allow Word to compress them, which will give them either a 220DPI or a 96DPI output, depending on the compression option chosen. Your only other option would be to change the printer's DPI settings, but the code to do that (if supported by the printer) would be printer-specific.


这篇关于在打印之前更改Word文档的DPI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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