Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3116

Print documents go to the print spool with status printing, but its not printing document using rawprint nuget packages C#

$
0
0

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.


Viewing all articles
Browse latest Browse all 3116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>