0

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)

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by abu taher
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.