Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi Expert,

I have created custom paper size for my printing and it is successfully created and listed into Forms list but the Problem is when i read available paper sizes from system using following code then it will not display my custom size paper listbox.

Code to fetch paper size:

C#
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
for (int p = 0; p < pd.PrinterSettings.PaperSizes.Count; p++)
{
    //My custom page size (Bill Printing 3.5x3) not display in this Listbox 
    listBox1.Items.Add(pd.PrinterSettings.PaperSizes[p].PaperName);
}


Step that i have performed to create custom paper size on windows printer.

1. Click Control Panel
2. Click the Printers and Faxes control panel icon
3. Choose File, then Server Properties.

In the dialog box that appears, check the box for Create a new form.
Created new page size as 'Bill Printing 3.5x3'
Select English units
Define the page size with the long dimension as the width=3.50in and the height=3.00in.
Click the Save Form button.
Click the OK button.

Any answer will be appreciated!

Thanks in advance,
Imdadhusen.
Posted
Updated 17-Mar-11 23:47pm
v2
Comments
Sunasara Imdadhusen 25-Mar-11 3:37am    
Nobody has any idea? If you have then please please...

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900