Changing the settings of a printer


hi all,

i am trying create windows forms application allows user print sequence of files. want print using shell execute (system.diagnostics.process). however, want give user ability select printer & printer settings print through.

i have tried code given in following article,

http://www.codeproject.com/articles/6899/changing-printer-settings-using-c

using it, able change settings of local printers, attempting access remote printers throws "access denied" win32exception - after making changes suggested in comments.

i have tried system.printing namespace. attempting create printquery on local printer (windows xps document writer) throws error stating "attempt security transparent method 'ms.internal.printwin32thunk.printerdefaults.dispose(boolean)' access security critical method 'ms.internal.printwin32thunk.printerdefaults.internaldispose(boolean)' failed."

is there way through c#? appreciated, have been banging head on screen while now. :p

thanks!

cheers,

thimila

hi thimila,

"is there fix/workaround issue on .net 4.0 when creating printqueue object..."

there article talking issue including workaround. please check see if helps.

methodaccessexception when printqueuecollection disposed

http://connect.microsoft.com/visualstudio/feedback/details/552520/methodaccessexception-when-printqueuecollection-disposed


bob shen
msdn community support | feedback us
develop , promote apps in windows store
please remember mark replies answers if , unmark them if provide no help.



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user