I am trying to send a PDF to a thermal printer using c#. I have looked at the RawPrinterHelper class here http://support.microsoft.com/kb/322091 but the SendFileToPrinter is not printing the file.
There is no error and the file appears to be printing from the print queue but nothing happens.
The printer works fine as I have been able to print other items on it.
Does anyone know how I can send a PDF to print or how I can possibly use the SendFileToPrinter to work for me.
I am working on Windows 7.
Here is a sample of the code I am using to call the SendFileToPrinter method.
try
{
RawPrinterHelper.SendFileToPrinter(PrinterName,@"C:\test.pdf");
}
catch (Exception ex)
{
Console.WriteLine(" EXCEPTION: {0}", ex.Message);
}
Update: Ok, maybe I spoke too soon. I am able to print the PDF to the thermal printer but the issue now is that this is taking a couple of seconds to print and I am looking for something that is "quick". The reason it is slow is that Adobe needs to open up first.
Anyone have any ideas on how to get around this?
System.DrawingandSystem.Drawing.Printingnamespaces. The hard part is loading the PDF file and drawing it to a surface. You might be better off using an application that can do the PDF printing for you, and calling that from your app. - David Crowell