пока я использую метод Print() для запуска процесса печати.
Код: Выделить всё
printDocument.Print(); // Ideally I should return the given Printing Job id
Код: Выделить всё
LocalPrintServer printServer = new LocalPrintServer();PrintQueue printQueue = printServer.GetPrintQueue(printerName);
Код: Выделить всё
// Set an undefined jobint jobId = -1;
Код: Выделить всё
// Get the job ID from the Queue given the unique document namePrintJobInfoCollection
jobs = printQueue.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo job in jobs)
{
if (job.Name == $"{documentName}_{uniqueNameId}")
{
jobId = job.JobIdentifier;_logger.LogInformation($"Job ID: {jobId}");break;
}
}
Есть ли у вас идеи, как этого добиться? Я обнаружил, что есть некоторые события, такие как PrintDocument.BeginPrint Event. Может быть, это может быть как-то полезно для получения идентификатора задания? Или мне придется напрямую использовать API диспетчера очереди печати?
Заранее спасибо!
Подробнее здесь: https://stackoverflow.com/questions/784 ... d-in-net-c
Мобильная версия