Tuesday, March 27, 2012

Can I find the default printer

I have successfully modified the routines from here http://msdn2.microsoft.com/en-us/library/ms252091(VS.80).aspx and can print OK on the Development machine but I have had to code the default printer name

I want to be able to get the users default printer and also set the orientation I don't know if this is possible in ASP

I have been able to get the default printer but cannot change the orientation any ideas?

To Get and Set the default Printer works OK
PrintDocument printDoc =newPrintDocument();
string printerName = printDoc.PrinterSettings.PrinterName;//Get the name
printDoc.PrinterSettings.PrinterName = printerName;//use the name

This below does not seem to work??
printDoc.PrinterSettings.DefaultPageSettings.Landscape =true;

|||

HI,jnc:

Try to change this line :

printDoc.PrinterSettings.DefaultPageSettings.Landscape =true;

To this:

printDoc.DefaultPageSettings.Landscape =true;

If i misunderstand you about your question, please feel free to correct me and i will try to help you with more information.

I hope the above information will be helpful. If you have any issues or concerns, please let me know. It's my pleasure to be of assistance

|||

Perfect timing, I was just revisiting this and your solution worked fine

No comments:

Post a Comment