Note that there are some explanatory texts on larger screens.

plurals
  1. POC# WPF Paginator printer ignoring user's printer selection
    primarykey
    data
    text
    <p>I am using the following code in my project. The print dialog shows, but it always prints on the default printer regardless of the user's selection. I have read similar topics but none of them seem to use the SerializerWriterCollator. What is the problem?</p> <pre><code> PrintQueue printQueue = LocalPrintServer.GetDefaultPrintQueue(); XpsDocumentWriter xpsWriter = PrintQueue.CreateXpsDocumentWriter(printQueue); SerializerWriterCollator batchPrinter = xpsWriter.CreateVisualsCollator(); var printDialog = new PrintDialog(); if (printDialog.ShowDialog() == true) { PrintTicket ticket = printDialog.PrintTicket; ticket.PageOrientation = PageOrientation.Landscape; var paginator1 = new PagePrinter(winchFlightsCount, new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight), winchFlights); var paginator2 = new PagePrinter(tugFlightCount, new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight), tugFlights); var paginator3 = new PagePrinter(selfFlightCount, new Size(printDialog.PrintableAreaWidth, printDialog.PrintableAreaHeight), selfFlights); batchPrinter.BeginBatchWrite(); for (int i = 0; i &lt; paginator1.PageCount; i++) { batchPrinter.Write(paginator1.GetPage(i).Visual, ticket); } for (int i = 0; i &lt; paginator2.PageCount; i++) { batchPrinter.Write(paginator2.GetPage(i).Visual, ticket); } for (int i = 0; i &lt; paginator3.PageCount; i++) { batchPrinter.Write(paginator3.GetPage(i).Visual, ticket); } batchPrinter.EndBatchWrite(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload