Interface IPrinterDiscoveryService
- Namespace
- combit.Reporting.Printing.Pdf
- Assembly
- combit.ListLabel31.CrossPlatform.Printing.Pdf.dll
Provides methods for discovering printers on the system and querying their capabilities.
public interface IPrinterDiscoveryService
Methods
GetCapabilitiesAsync(string, CancellationToken)
Queries the detailed capabilities of a specific printer.
Task<PrinterCapabilities?> GetCapabilitiesAsync(string printerName, CancellationToken cancellationToken = default)
Parameters
printerNamestringThe system name of the printer to query.
cancellationTokenCancellationTokenToken used to observe cancellation requests.
Returns
- Task<PrinterCapabilities>
A PrinterCapabilities describing the printer's features, or null when the printer does not exist or its capabilities cannot be determined.
Exceptions
- ArgumentNullException
Thrown when
printerNameis null.
GetPrinterAsync(string, CancellationToken)
Retrieves information about a specific printer by its system name.
Task<PrinterInfo?> GetPrinterAsync(string printerName, CancellationToken cancellationToken = default)
Parameters
printerNamestringThe system name of the printer to look up.
cancellationTokenCancellationTokenToken used to observe cancellation requests.
Returns
- Task<PrinterInfo>
A PrinterInfo for the requested printer, or null when no printer with the specified name exists.
Exceptions
- ArgumentNullException
Thrown when
printerNameis null.
GetPrintersAsync(CancellationToken)
Enumerates all printers available on the current system.
Task<IReadOnlyList<PrinterInfo>> GetPrintersAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenToken used to observe cancellation requests.
Returns
- Task<IReadOnlyList<PrinterInfo>>
A read-only list of PrinterInfo instances describing each discovered printer. Returns an empty list when no printers are found.