Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfPrinterServiceExtensions

OfficeIMO.Workflows

Namespace
OfficeIMO.Workflows
Assembly
OfficeIMO.Workflows
Source revision
ac7e6e1bad8a with working tree changes
Modifiers
static

Operations composed from the IPdfPrinterService members.

Inheritance

  • object
  • PdfPrinterServiceExtensions

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.