question

StephensMike-9082 avatar image
0 Votes"
StephensMike-9082 asked ·

CreateXpsDocumentWriter and spool id

When submitting a file to the Windows print spool via CreateXpsDocumentWriter() how does one obtain the id of the spooled job?

dotnet-standard
· 2
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @StephensMike-9082 ,

When submitting a file to the Windows print spool via CreateXpsDocumentWriter()

Could you provide some related code here? It will help us analyze your problem and make a test.
We are waiting for your update.

0 Votes 0 ·
          // Print XPS file
          try
              {
               print_queue = lps.GetPrintQueue(print_queue_nm);
 
              Xpsdoc = new XpsDocument(pcb.tempFilePath, System.IO.FileAccess.Read);


              print_queue.CurrentJobSettings.Description = file_name;
              XpsDocumentWriter xdwPrint = PrintQueue.CreateXpsDocumentWriter(print_queue);

              // Get default PrintTicket from printer
              PrintTicket printTicket = print_queue.DefaultPrintTicket.Clone();
              printTicket.CopyCount   = (int) pcb.spoolInfo.Copies;

              // Write XPS document to the printer
              xdwPrint.Write(Xpsdoc.GetFixedDocumentSequence().DocumentPaginator, printTicket);
              }

When xdwPrint.Write() is invoked, the xps file is written to the Windows spool for the specified print queue. However how can we obtain the spool id of this job?

0 Votes 0 ·

0 Answers