How to customise the paper size to 6 inch by 10 inch

I tried the following, giving problem

printer.height = 600
printer.width = 15100

while running it will eject full sheet of a4 after printing

Kindly help me to solve this problem (any code example is better)

Recommended Answers

All 3 Replies

For the Printer object setting the height and width set at run time, values are used instead of the setting of the PaperSize property. Height and width are for the Printer object are always specified in twips with 1440 twips per inch. So a 6 inch height = 8640 twips; a 10 inch width = 14,400. Your height setting is less than half an inch.

"If you set the Height and Width properties for a printer driver that doesn't allow these properties to be set, no error occurs and the size of the paper remains as it was. If you set Height and Width for a printer driver that allows only certain values to be specified, no error occurs and the property is set to whatever the driver allows. For example, you could set Height to 150 and the driver would set it to 144."

You may find i easier tp use one of the standard PageSize constants here http://msdn.microsoft.com/en-us/library/aa245867(VS.60).aspx

I think you can get help from it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.