Very slow printing from WPF Very slow printing from WPF wpf wpf

Very slow printing from WPF


This is pretty much what I do, which is really fast for me:

        LocalPrintServer localPrintServer = new LocalPrintServer();        System.Printing.PrintQueue pq = new System.Printing.PrintQueue(localPrintServer, localPrintServer.DefaultPrintQueue.FullName);        System.Windows.Xps.XpsDocumentWriter docWriter = System.Printing.PrintQueue.CreateXpsDocumentWriter(pq);        PrintCapabilities pc = pq.GetPrintCapabilities();        PageImageableArea pia = pc.PageImageableArea;        if (docWriter != null)        {            DocumentPaginator paginator = ((IDocumentPaginatorSource)copy).DocumentPaginator;            // Change the PageSize and PagePadding for the document to match the CanvasSize for the printer device.            paginator.PageSize = new System.Windows.Size(pia.ExtentWidth, pia.ExtentHeight);            // Send content to the printer.            docWriter.Write(paginator);        }

I don't use the loop that you use as I've never needed it. I just let it go, and deal with any errors as they arrive later (that is after I've already checked the printer status before hand). To check the printer status, you just look at the status properties on the printer queue, that you're using.

I hope that helps in any way.