Class
PdfPrinterServiceExtensions
OfficeIMO.Workflows
Operations composed from the IPdfPrinterService members.
Inheritance
- object
- PdfPrinterServiceExtensions
Methods
public static async Task<OfficePrintResult> PrintAsync(IPdfPrinterService printers, OfficePrintRequest request, CancellationToken cancellationToken = default) #Prints a document in one call: converts it to PDF in memory when it is not one, lays out the sheets, and submits the job.
Parameters
- printers OfficeIMO.Workflows.IPdfPrinterService
- Printer service that delivers the job.
- request OfficeIMO.Workflows.OfficePrintRequest
- Document, layout and delivery settings.
- cancellationToken System.Threading.CancellationToken = default
- Cancels conversion, composition or submission.
Returns
Task<OfficePrintResult>Exceptions
OfficeConversionException– The document could not be converted; nothing was submitted.PdfPrintDeliveryException– Delivery was interrupted after submission began; check the queue before retrying.
public static async Task<PdfPrintJobStatus> WaitForJobAsync(IPdfPrinterService printers, string printerName, string jobId, TimeSpan timeout, TimeSpan? pollInterval = null, CancellationToken cancellationToken = default) #Polls a submitted job until it reaches a terminal state.
Parameters
- printers OfficeIMO.Workflows.IPdfPrinterService
- Printer service the job was submitted through.
- printerName string
- The receipt's PdfPrintSubmission.PrinterName.
- jobId string
- The receipt's PdfPrintSubmission.JobId.
- timeout System.TimeSpan
- Longest wait, or Timeout.InfiniteTimeSpan.
- pollInterval System.TimeSpan? = null
- Delay between queries; defaults to one second.
- cancellationToken System.Threading.CancellationToken = default
- Stops waiting; the job is not canceled.
Exceptions
TimeoutException– The job was not terminal when the timeout elapsed.