Setting the paper size

后端 未结 5 735
灰色年华
灰色年华 2021-02-14 03:49

Please help me on how to set my paper size in c# code. I am using the API printDocument.

Below is my code:

 ppvw = new PrintPreviewDialog();
 ppvw.Docume         


        
5条回答
  •  爱一瞬间的悲伤
    2021-02-14 04:00

    Constructor for paper size is PaperSize(String, Int32, Int32)

    5.0 (5) X 5.0 (5) is too little,,, Unless "Custom Size" is your string.. or 420 x 594 for A2...

    and also try enumerating foreach PaperSize size in printer.PaperSizes and check whether A2 is there.. or not..

    By default it sets Rawkind to custom, You also need to set Rawkind as mentioned in http://msdn.microsoft.com/en-us/library/system.drawing.printing.papersize.rawkind.aspx

提交回复
热议问题