Table of Contents

Interface IPdfPrintService

Namespace
combit.Reporting.Printing.Pdf
Assembly
combit.ListLabel31.CrossPlatform.Printing.Pdf.dll

Provides methods for printing PDF documents to a specified printer, with support for both file-based and stream-based input. The service automatically selects the best printing method (passthrough or rasterized) based on printer capabilities and the configured PrintJobOptions.

public interface IPdfPrintService

Methods

PrintAsync(Stream, string, PrintJobOptions?, CancellationToken)

Prints a PDF document from a stream to the specified printer. The stream contents are read into memory and passed directly to the print backend; no temporary file is created on disk.

Task<PrintResult> PrintAsync(Stream pdfStream, string printerName, PrintJobOptions? options = null, CancellationToken cancellationToken = default)

Parameters

pdfStream Stream

A readable stream containing the PDF document.

printerName string

The system name of the target printer.

options PrintJobOptions

Optional print job settings. When null, default options are used.

cancellationToken CancellationToken

Token used to observe cancellation requests.

Returns

Task<PrintResult>

A PrintResult describing whether the print operation succeeded, the method used, and any error or diagnostic information.

Exceptions

ArgumentNullException

Thrown when pdfStream or printerName is null.

ArgumentException

Thrown when printerName is empty or whitespace, or when pdfStream is not readable.

PrintAsync(string, string, PrintJobOptions?, CancellationToken)

Prints a PDF document from a file path to the specified printer.

Task<PrintResult> PrintAsync(string pdfFilePath, string printerName, PrintJobOptions? options = null, CancellationToken cancellationToken = default)

Parameters

pdfFilePath string

The absolute path to the PDF file to print.

printerName string

The system name of the target printer.

options PrintJobOptions

Optional print job settings. When null, default options are used.

cancellationToken CancellationToken

Token used to observe cancellation requests.

Returns

Task<PrintResult>

A PrintResult describing whether the print operation succeeded, the method used, and any error or diagnostic information.

Exceptions

ArgumentNullException

Thrown when pdfFilePath or printerName is null.

ArgumentException

Thrown when pdfFilePath or printerName is empty or whitespace.

FileNotFoundException

Thrown when the file specified by pdfFilePath does not exist.