Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Interface

IPdfPrinterService

OfficeIMO.Workflows

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

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 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 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 required
cancellationToken System.Threading.CancellationToken = default optional
public abstract 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 abstract 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 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 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) #

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

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