|Below code works well for printing PDF when we have physical file.
But when we have bytes then it will not work. Is there a way we can print bytes to printer without showing the print dialog box.
private static void PrintPDF(string FileToPrint)
PrinterSettings setting = new PrinterSettings();
var printerName = setting.PrinterName;
ProcessStartInfo info = new ProcessStartInfo(FileToPrint);
info.Verb = "Print";
info.CreateNoWindow = true;
info.WindowStyle = ProcessWindowStyle.Hidden;
There is a Microsoft Knowledge base article on this particular problem. Here in the article they send byte to the printer using Winspool API of Windows OS. but i don't feel it is optimized for web.