简体   繁体   English

如何以编程方式更改打印对话框的纸张大小C#?

[英]How to Change Paper Size of a print dialog programatically C#?

I Want to Change the paper size to a user-defined paper size programatically in C# for Eg: 10x12 is my Paper Size. 我想在C#中以编程方式将纸张尺寸更改为用户定义的纸张尺寸,例如:10x12是我的纸张尺寸。 It is much better if you help me in how to print in Crystal Report with the paper size 10x12. 如果您帮助我如何使用纸张尺寸10x12打印Crystal Report,会更好。

IN OnBegin Event of the print document class,set the below coding for custom paper size : IN OnBegin打印文档类的事件,为自定义纸张大小设置以下编码:

     Dim xCustomSize As New PaperSize("Custom", 10, 12)
            xCustomSize.PaperName = PaperKind.Custom

 PrintDocument.DefaultPageSettings.PaperSize =xCustomSize 

* For Crystal Report : * *水晶报告:*

MYCRYSTALREPORT crpt = new MYCRYSTALREPORT();
crpt.PrintOptions.PaperSize = xCustomSize ;

for more detail: http://social.msdn.microsoft.com/Forums/en-US/9e647fac-d5cd-42b7-a1e6-db6d6cf97c57/setting-pagesize-for-crystal-report?forum=vscrystalreports 更多详细信息: http//social.msdn.microsoft.com/Forums/en-US/9e647fac-d5cd-42b7-a1e6-db6d6cf97c57/setting-pagesize-for-crystal-report?forum=vscrystalreports

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM