How to print with custom paper size in winforms

前端 未结 2 764
陌清茗
陌清茗 2020-12-25 14:11

I\'m trying to print a document in my application. But on different printers i get different results. This is my code:

PaperSize paperSize = new PaperSize(\"         


        
2条回答
  •  青春惊慌失措
    2020-12-25 14:56

    After the PrintDialog closes, don't just set

    pd.DefaultPageSettings.PaperSize = paperSize;
    

    Try also setting

    pd.PrinterSettings.DefaultPageSettings.PaperSize = paperSize;
    

    I think that will take care of it.

提交回复
热议问题