# IPdfPrinterService

Printer discovery, job delivery and job tracking. Transports receive the job content and the delivery options.

Interface 

`OfficeIMO.Workflows`

**Namespace**

`OfficeIMO.Workflows`

**Assembly**

`OfficeIMO.Workflows`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[PdfPrinterService.cs:92](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Workflows/Printing/PdfPrinterService.cs#L92)

**Modifiers**

abstract

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](/api/workflows/officeimo-workflows-ipdfprinterservice/#extension-printasync-officeimo-workflows-ipdfprinterservice-officeimo-workflows-officeprintrequest-threading-cancellationtoken) parameter `printers`
- Extension method [IPdfPrinterService.WaitForJobAsync](/api/workflows/officeimo-workflows-ipdfprinterservice/#extension-waitforjobasync-officeimo-workflows-ipdfprinterservice-string-string-timespan-nullable-system-timespan-threading-cancellationtoken) parameter `printers`
- Method [PdfPrinterServiceExtensions.PrintAsync](/api/workflows/officeimo-workflows-pdfprinterserviceextensions/#method-printasync-officeimo-workflows-ipdfprinterservice-officeimo-workflows-officeprintrequest-threading-cancellationtoken) parameter `printers`
- Method [PdfPrinterServiceExtensions.WaitForJobAsync](/api/workflows/officeimo-workflows-pdfprinterserviceextensions/#method-waitforjobasync-officeimo-workflows-ipdfprinterservice-string-string-timespan-nullable-system-timespan-threading-cancellationtoken) parameter `printers`

Filter members 

Show inherited

## Methods

`public abstract Task<PdfPrintJobStatus> CancelJobAsync(string printerName, string jobId, CancellationToken cancellationToken = default)` [#](#method-canceljobasync-string-string-threading-cancellationtoken)

Asks the queue to cancel a job and returns its state afterwards. A job that has already finished is reported unchanged.

Parameters

**printerName string required**

The receipt's [PdfPrintSubmission.PrinterName](/api/workflows/officeimo-workflows-pdfprintsubmission/).

**jobId string required**

The receipt's [PdfPrintSubmission.JobId](/api/workflows/officeimo-workflows-pdfprintsubmission/).

**cancellationToken System.Threading.CancellationToken = default optional**

Cancels the request; the job may already be canceled.

Returns

`Task<PdfPrintJobStatus>`

`public abstract Task<PdfPrinterCapabilities> GetCapabilitiesAsync(string printerName, CancellationToken cancellationToken = default)` [#](#method-getcapabilitiesasync-string-threading-cancellationtoken)

Reports the selected printer's media, trays and features without changing printer settings.

Parameters

**printerName string required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<PdfPrinterCapabilities>`

`public abstract Task<PdfPrintJobStatus> GetJobAsync(string printerName, string jobId, CancellationToken cancellationToken = default)` [#](#method-getjobasync-string-string-threading-cancellationtoken)

Reads the current state of a submitted job.

Parameters

**printerName string required**

The receipt's [PdfPrintSubmission.PrinterName](/api/workflows/officeimo-workflows-pdfprintsubmission/).

**jobId string required**

The receipt's [PdfPrintSubmission.JobId](/api/workflows/officeimo-workflows-pdfprintsubmission/).

**cancellationToken System.Threading.CancellationToken = default optional**

Cancels the query.

Returns

`Task<PdfPrintJobStatus>`

`public abstract Task<IReadOnlyList<PdfPrinterInfo>> GetPrintersAsync(CancellationToken cancellationToken = default)` [#](#method-getprintersasync-threading-cancellationtoken)

Lists installed queues without changing printer settings.

Parameters

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<IReadOnlyList<PdfPrinterInfo>>`

`public abstract Task<PdfPrintSubmission> SubmitAsync(PdfPrintJob job, PdfPrintDeliveryOptions options, CancellationToken cancellationToken = default)` [#](#method-submitasync-officeimo-workflows-pdfprintjob-officeimo-workflows-pdfprintdeliveryoptions-threading-cancellationtoken)

Submits a composed job and returns an acceptance receipt.

Parameters

**job OfficeIMO.Workflows.PdfPrintJob required**

**options OfficeIMO.Workflows.PdfPrintDeliveryOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<PdfPrintSubmission>`

## Extension Methods

`public static async Task<OfficePrintResult> PrintAsync(IPdfPrinterService printers, OfficePrintRequest request, CancellationToken cancellationToken = default)` [#](#extension-printasync-officeimo-workflows-ipdfprinterservice-officeimo-workflows-officeprintrequest-threading-cancellationtoken)

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 required**

Printer service that delivers the job.

**request OfficeIMO.Workflows.OfficePrintRequest required**

Document, layout and delivery settings.

**cancellationToken System.Threading.CancellationToken = default optional**

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)` [#](#extension-waitforjobasync-officeimo-workflows-ipdfprinterservice-string-string-timespan-nullable-system-timespan-threading-cancellationtoken)

Polls a submitted job until it reaches a terminal state.

Parameters

**printers OfficeIMO.Workflows.IPdfPrinterService required**

Printer service the job was submitted through.

**printerName string required**

The receipt's [PdfPrintSubmission.PrinterName](/api/workflows/officeimo-workflows-pdfprintsubmission/).

**jobId string required**

The receipt's [PdfPrintSubmission.JobId](/api/workflows/officeimo-workflows-pdfprintsubmission/).

**timeout System.TimeSpan required**

Longest wait, or Timeout.InfiniteTimeSpan.

**pollInterval System.TimeSpan? = null optional**

Delay between queries; defaults to one second.

**cancellationToken System.Threading.CancellationToken = default optional**

Stops waiting; the job is not canceled.

Returns

`Task<PdfPrintJobStatus>` The job in its terminal state.

Exceptions

- `TimeoutException` – The job was not terminal when the timeout elapsed.

<!-- PowerForge markdown artifact sha256:FBD50592066CC60ADEF1451F355AC3B2980F626F05A4298FEF4EB0710B5B5B97 -->
