I am implementing print document without print dialog using rawprint nuget packages C#
When i print word document with print dialog then it adds to print queue with status "Printing" and successfullyprint the document.
When i print PDF document with "PrinterName" and FilePath using rawprint nuget packages C#, then it's add to print queue with status "Printing" But no print out from printer.
My code sample given bellow
public void printPDF(string printerName) { // Absolute path to your PDF to print (with filename) string combinedPdf = new UrlHelper(System.Web.HttpContext.Current.Request.RequestContext).Content("~/temp/") +"conbined_5248422286163515789.pdf"; // The name of the PDF that will be printed (just to be shown in the print queue) string Filepath = System.Web.HttpContext.Current.Server.MapPath(combinedPdf); if (System.IO.File.Exists(Filepath)) { string Filename = "conbined_5248422286163515789.pdf"; // The name of the printer that you want to use // Note: Check step 1 from the B alternative to see how to list // the names of all the available printers with C# string PrinterName = printerName; // Create an instance of the Printer IPrinter printer = new Printer(); // Print the file printer.PrintRawFile(PrinterName, Filepath, Filename); } }
Please help and suggest.