Namespace combit.Reporting.Printing.Pdf
Classes
- PdfPrintService
Default implementation of IPdfPrintService that orchestrates the full print pipeline: input validation, printer capability probing, PDF passthrough, and rasterized fallback printing.
Print a PDF file from disk: using combit.Reporting.Printing.Pdf; var printerName = "My Printer"; var pdfPath = "document.pdf"; using var printService = new PdfPrintService(); PrintResult result = await printService.PrintAsync( pdfPath, printerName, options: new PrintJobOptions { PreferPdfPassthrough = true }, cancellationToken: CancellationToken.None); if (!result.Success) { Console.WriteLine(result.ErrorMessage); Console.WriteLine(result.Diagnostics); }Print a PDF from a Stream: using combit.Reporting.Printing.Pdf;var printerName = "My Printer"; await using FileStream pdfStream = File.OpenRead("document.pdf");
using var printService = new PdfPrintService(); PrintResult result = await printService.PrintAsync( pdfStream, printerName, options: new PrintJobOptions { RasterDpi = 300 }, cancellationToken: CancellationToken.None);
- PrintJobOptions
Configures how a PDF document is printed, including copy count, duplex mode, paper size, scaling behavior, rasterization DPI, and passthrough preference.
- PrintResult
Represents the outcome of a PDF print operation, including whether the operation succeeded, the method used, and optional error or diagnostic information.
- PrinterCapabilities
Describes the capabilities of a specific printer, including supported media types, paper sizes, duplex mode, color support, and maximum copies.
- PrinterDiscoveryService
Default implementation of IPrinterDiscoveryService that delegates to a platform-specific combit.Reporting.Printing.Pdf.Internal.IPrinterCapabilityProbe.
Enumerate printers: using combit.Reporting.Printing.Pdf; using var discovery = new PrinterDiscoveryService(); IReadOnlyList<PrinterInfo> printers = await discovery.GetPrintersAsync(); foreach (PrinterInfo printer in printers) { Console.WriteLine(printer.Name); }Query capabilities for a specific printer: using combit.Reporting.Printing.Pdf;var printerName = "My Printer"; using var discovery = new PrinterDiscoveryService(); PrinterCapabilities? capabilities = await discovery.GetCapabilitiesAsync(printerName); if (capabilities is not null) { Console.WriteLine($"PDF passthrough: {capabilities.SupportsPdfPassthrough}"); }
- PrinterInfo
Describes a printer discovered on the system, including its name, availability, and PDF passthrough support.
Interfaces
- IPdfPrintService
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.
- IPrinterDiscoveryService
Provides methods for discovering printers on the system and querying their capabilities.
Enums
- DuplexMode
Specifies the duplex (double-sided) printing mode.
- PrintMethod
Identifies the method used to deliver a PDF document to the printer.
- PrintScalingMode
Specifies how a PDF page is scaled when sent to a printer.