Printing the PDF only if we set printer as default printer in C#.net -


the below code used print pdf.

private void printreport(string printername,string filepath)         {              processstartinfo info = new processstartinfo();             info.verb = "print";             info.filename = filepath;             info.createnowindow = true;             info.windowstyle = processwindowstyle.hidden;             info.arguments = printername;              process p = new process();             p.startinfo = info;             p.startinfo.arguments = string.format(@"/p {0}/h {1}", printername, filepath);              p.start();               p.waitforinputidle();             system.threading.thread.sleep(3000);             if (false == p.closemainwindow())                 p.kill();              if (file.exists(filepath))             {                 file.delete(filepath);             }            } 

but work if printer specified default printer. need print in of printer specified(printername) .can tell me issue?


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -