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
pdfStreamStreamA readable stream containing the PDF document.
printerNamestringThe system name of the target printer.
optionsPrintJobOptionsOptional print job settings. When null, default options are used.
cancellationTokenCancellationTokenToken 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
pdfStreamorprinterNameis null.- ArgumentException
Thrown when
printerNameis empty or whitespace, or whenpdfStreamis 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
pdfFilePathstringThe absolute path to the PDF file to print.
printerNamestringThe system name of the target printer.
optionsPrintJobOptionsOptional print job settings. When null, default options are used.
cancellationTokenCancellationTokenToken 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
pdfFilePathorprinterNameis null.- ArgumentException
Thrown when
pdfFilePathorprinterNameis empty or whitespace.- FileNotFoundException
Thrown when the file specified by
pdfFilePathdoes not exist.