# PdfPrinterService

Delivers print jobs to IPP printers by URI, to CUPS queues through the local scheduler, and to Windows queues through GDI.

Class 

`OfficeIMO.Workflows`

**Namespace**

`OfficeIMO.Workflows`

**Assembly**

`OfficeIMO.Workflows`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

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

**Implements**

`IPdfPrinterService`

**Modifiers**

sealed

Delivers print jobs to IPP printers by URI, to CUPS queues through the local scheduler, and to Windows queues through GDI.

## Inheritance

- object
- PdfPrinterService

## Remarks

IPP printers receive vector PDF when they accept application/pdf, and PWG raster otherwise. Grayscale jobs stay vector PDF only for printers that also list the monochrome print-color-mode, unless [PdfPrintDeliveryOptions.RasterizeGrayscale](/api/workflows/officeimo-workflows-pdfprintdeliveryoptions/) is set. CUPS queues are reached over IPP at the local scheduler; when the scheduler is not reachable that way, or the queue is a discovered destination that the scheduler has not created yet, the CUPS command-line tools deliver the PDF instead. Windows queues receive raster sheets at the device resolution.

Filter members 

Show inherited

## Constructors

`public PdfPrinterService()` [#](#constructor-ctor)

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

Creates a service that uses the local CUPS scheduler where one is installed.

## Methods

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

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

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 Task<PdfPrinterCapabilities> GetCapabilitiesAsync(string printerName, CancellationToken cancellationToken = default)` [#](#method-getcapabilitiesasync-string-threading-cancellationtoken)

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

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 Task<PdfPrintJobStatus> GetJobAsync(string printerName, string jobId, CancellationToken cancellationToken = default)` [#](#method-getjobasync-string-string-threading-cancellationtoken)

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

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 Task<IReadOnlyList<PdfPrinterInfo>> GetPrintersAsync(CancellationToken cancellationToken = default)` [#](#method-getprintersasync-threading-cancellationtoken)

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

Lists installed queues without changing printer settings.

Parameters

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

Returns

`Task<IReadOnlyList<PdfPrinterInfo>>`

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

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

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>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:67928BCD616C48E2E6A942CEDF66F1F7EF0293AEC46DB8BD5A81D18483D90658 -->
