Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfPrinterService

OfficeIMO.Workflows

Namespace
OfficeIMO.Workflows
Assembly
OfficeIMO.Workflows
Source revision
ba882f6b0d07 with working tree changes
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 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.

Constructors

public PdfPrinterService() #

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) #

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.
jobId string required
The receipt's PdfPrintSubmission.JobId.
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) #

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

Parameters

printerName string required
cancellationToken System.Threading.CancellationToken = default optional
public Task<PdfPrintJobStatus> GetJobAsync(string printerName, string jobId, CancellationToken cancellationToken = default) #

Reads the current state of a submitted job.

Parameters

printerName string required
The receipt's PdfPrintSubmission.PrinterName.
jobId string required
The receipt's PdfPrintSubmission.JobId.
cancellationToken System.Threading.CancellationToken = default optional
Cancels the query.

Returns

Task<PdfPrintJobStatus>
public Task<IReadOnlyList<PdfPrinterInfo>> GetPrintersAsync(CancellationToken cancellationToken = default) #

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) #

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>