Windows 8 blows error on c# process for printing pdf file, how? -


the following code @ least works printing pdf file in windows 7, blowing error in windows 8:

                process process = new process();             //process.startinfo.createnowindow = true;             process.startinfo.windowstyle = processwindowstyle.hidden;             process.startinfo.filename = deffile;             if (rwprinter.length > 0)             {                 process.startinfo.verb = "printto";                 process.startinfo.arguments = "\"" + rwprinter + "\"";             }             else             {                 process.startinfo.verb = "print";             }             process.start(); 

here details of error:

************** exception text ************** system.componentmodel.win32exception (0x80004005):  no application associated       specified file operation @ system.diagnostics.process.startwithshellexecuteex(processstartinfo startinfo) @ system.diagnostics.process.start() @ ecitation.form1.process_ticket(string jobdo) @ ecitation.form1.btnprint_click(object sender, eventargs e) 

i know there's adobe reader pdf files anyways stuck need working on windows 8 error doesn't happen again.

edit, weird in windows 8: printto not recognized internal or external command

i tried googling shocked no results come up. want programmically print document specific printer.

the error message tells need know. there nothing defined printto verb on .pdf file extension. you'll need configure file associations remedy if want approach work.

the way attempting pretty brittle, relying on vagueries of third party pdf viewer. if control machines on application runs, can configure pdf viewer like. otherwise can expect deal lot of customer support. more robust solution build pdf printing capability application using 1 of many libraries offer such capabilities.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -