How to set my custom paper to defualt paper size??

Aug 19 2010 12:55 PM
Hi All,

I am facing a problem. I have Created a new form from Server Properties for printing. I set that custom settings to default in windows printer but when i want to print crystal report in C# and check there default printer paper then it shows letter size. In Report printer default settings my custom paper not selected as default paper size. I have to set it manually every time when print.

I have populated a list of all papers in my printer attached to my PC. It display total 19 records. My custom paper named "Receipt" index number is 17. When i put that 17 in the following code:

PrintDocument pd;
pd.DefaultPageSettings.PaperSize = pd.PrinterSettings.PaperSizes[17];

I have tried this also
pd.DefaultPageSettings.PaperSize = pd.PrinterSettings.PaperSizes[ListBox1.SelectedIndex];


it gives error "Object reference not set to an instance of an object"

Even i put different indexes but the error is same.

How to set my custom paper to defualt paper size.

Please help in this issue. I want to print Receipt according to my custom settings. Please Guys help me!