Hi all,

I have develop the c# console application in which I am going to print command with print orientation like landsacpe/Portrait. But I noticed that the actual setting of the file over writr the console command. For example I have a *.xls file and set its printing property as landscape. and when I try to print this file as portrait through console(COMMAND PROMT) it overwrite the command and print as Landscape.

here is code

if (args[2].ToLower() == "landscape")
oPS.DefaultPageSettings.Landscape = true;
else if (args[2].ToLower() == "portrait")
oPS.DefaultPageSettings.Landscape = false;


I am also facing the same problem please someone help up