c# - 如何在 C# 中双面打印 Word.Document?
问题描述
快速总结
我可以使用PrintOut()
如下函数在 C# 中打印出 Word 文档:
object missing = Type.Missing;
Word.Application app = new Word.Application();
Word.Document doc = null;
object template = @"/path/Template.docx";
doc = app.Documents.Open(template, ReadOnly: true);
app.Visible = false;
// Print here
doc.PrintOut();
问题
我意识到如果有 2 页,我无法在两页上打印文档。2 页打印 2 张,而不是双面打印。
我在这里看了一下:https ://docs.microsoft.com/en-us/office/vba/api/Word.Document.PrintOut没有任何关于双面打印的信息。
问题
Word.Document
在纸的两面用 C#打印 a 的好方法是什么?
解决方案
它应该是您可以在物理打印机中更改的设置,如果这不起作用尝试调用 Microsoft.Office.Interop.Word.Document 对象的 PrintOut() 方法,并将 ManualDuplexPrint 参数设置为 true。
推荐阅读
- c# - 事件的发布者可以取消订阅它的听众吗?
- python - Python - webscraping - 多线程 - 线程限制?
- c++ - 创建一个包含 boost 适配器的自定义范围类
- sql - SQL Server:将 varchar 字段转换为日期
- .net - 鼠标按下或基于鼠标按钮更新控制光标
- javascript - JS-object-property 描述符本身如何不会导致无限循环?
- r - 突出显示箱线图中的点
- javascript - Web3js - 部署后立即返回智能合约地址
- android - 未调用 registerOnSharedPreferenceChangeListener
- email - 自动下载文件并上传到谷歌表格