IPdfPrinterService
OfficeIMO.Workflows
Printer discovery, job delivery and job tracking. Transports receive the job content and the delivery options.
Remarks
Every member that takes a printer name also accepts an ipp:// or ipps:// printer URI.
Usage
Explore 4 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Accepted by parameters 4
- Extension method IPdfPrinterService.PrintAsync
- Extension method IPdfPrinterService.WaitForJobAsync
- Method PdfPrinterServiceExtensions.PrintAsync
- Method PdfPrinterServiceExtensions.WaitForJobAsync
Methods
public abstract Task<PdfPrintJobStatus> CancelJobAsync(string printerName, string jobId, CancellationToken cancellationToken = default) #Asks the queue to cancel a job and returns its state afterwards. A job that has already finished is reported unchanged.
Parameters
- printerName string
- The receipt's PdfPrintSubmission.PrinterName.
- jobId string
- The receipt's PdfPrintSubmission.JobId.
- cancellationToken System.Threading.CancellationToken = default
- Cancels the request; the job may already be canceled.
Returns
Task<PdfPrintJobStatus>public abstract Task<PdfPrinterCapabilities> GetCapabilitiesAsync(string printerName, CancellationToken cancellationToken = default) #Reports the selected printer's media, trays and features without changing printer settings.
Parameters
- printerName string
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<PdfPrinterCapabilities>public abstract Task<PdfPrintJobStatus> GetJobAsync(string printerName, string jobId, CancellationToken cancellationToken = default) #Reads the current state of a submitted job.
Parameters
- printerName string
- The receipt's PdfPrintSubmission.PrinterName.
- jobId string
- The receipt's PdfPrintSubmission.JobId.
- cancellationToken System.Threading.CancellationToken = default
- Cancels the query.
Returns
Task<PdfPrintJobStatus>public abstract Task<IReadOnlyList<PdfPrinterInfo>> GetPrintersAsync(CancellationToken cancellationToken = default) #Lists installed queues without changing printer settings.
Parameters
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<IReadOnlyList<PdfPrinterInfo>>public abstract Task<PdfPrintSubmission> SubmitAsync(PdfPrintJob job, PdfPrintDeliveryOptions options, CancellationToken cancellationToken = default) #Submits a composed job and returns an acceptance receipt.
Parameters
- job OfficeIMO.Workflows.PdfPrintJob
- options OfficeIMO.Workflows.PdfPrintDeliveryOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<PdfPrintSubmission>Extension 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.