c# - 如何从 C# 代码将默认打印 'zoom > scale to paper size' 设置为 A4?

标签 c# winforms office-automation

我使用以下代码从我的 C# 应用程序创建 Word 文档:

oWord = new Word.Application();
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
oDoc.PageSetup.PaperSize = WdPaperSize.wdPaperLegal;

有没有办法可以指定(使用 C# 代码)打印选项

Zoom > "Scale to paper Size"

每次打印此文档时都是 A4 尺寸?

提前致谢!

最佳答案

您可以在打印文档时设置选项:在 PrintOut 方法中,指定以下值:

PrintZoomPaperWidth = 11907
PrintZoomPaperHeight = 16839

关于c# - 如何从 C# 代码将默认打印 'zoom > scale to paper size' 设置为 A4?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12261805/

相关文章:

c# - 如何与 Parallel.Invoke 并行启动方法?

automation - 以编程方式将来自多个演示文稿的幻灯片合并为一个演示文稿

C++ 优化破坏 OLE 自动化程序(非 MFC)

c# - C# 中与 java 中的标记和重置方法等效的方法是什么

C++/CLR DataSourceUpdateMode::OnPropertyChanged with TextBox 将光标向左移动

c# - 在 C# 中的两台 PC 之间流式传输数据,没有 IP 网络

C# 非矩形按钮

excel - 通过 API 将文件另存为 PDF 所需的 Excel 2007 中 PDF 的文件类型号是多少?

c# - Kendo Grid 获取 ClientTemplate 中类型的属性值

C# MVC : What is a good way to prevent Denial Of Service (DOS) attacks on ASP. NET 站点?