PrintingFfi class

A class that provides a Dart interface to the native printing libraries.

This class uses FFI to call native functions for listing printers, printing documents, and managing print jobs on macOS, Windows, and Linux.

Constructors

PrintingFfi.forTest(PrintingFfiBindings _bindings, {Future<SendPort>? helperIsolateSendPortFuture})
Constructor for testing purposes.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildOptions(List<PrintOption> options) Map<String, String>
cancelPrintJob(String printerName, int jobId) Future<bool>
dispose() → void
getDefaultPrinter() Printer?
getSupportedCupsOptions(String printerName) Future<List<CupsOptionModel>>
getWindowsPrinterCapabilities(String printerName) Future<WindowsPrinterCapabilitiesModel?>
handleIsolateMessageForTest(dynamic data) → void
A test-only method to allow injecting messages as if they came from the isolate.
initPdfium() → void
Initializes the bundled PDFium library for Windows.
listPrinters() List<Printer>
listPrintJobs(String printerName) Future<List<PrintJob>>
listPrintJobsStream(String printerName, {Duration pollInterval = const Duration(seconds: 2)}) Stream<List<PrintJob>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openPrinterProperties(String printerName, {int hwnd = 0}) Future<PrinterPropertiesResult>
pausePrintJob(String printerName, int jobId) Future<bool>
printPdf(String printerName, String pdfFilePath, {String docName = 'Flutter PDF Document', PdfPrintScaling scaling = PdfPrintScaling.fitToPrintableArea, int? copies, PageRange? pageRange, List<PrintOption> options = const []}) Future<bool>
printPdfAndStreamStatus(String printerName, String pdfFilePath, {String docName = 'Flutter PDF Document', PdfPrintScaling scaling = PdfPrintScaling.fitToPrintableArea, int? copies, PageRange? pageRange, List<PrintOption> options = const [], Duration pollInterval = const Duration(seconds: 2)}) Stream<PrintJob>
rawDataToPrinter(String printerName, Uint8List data, {String docName = 'Flutter Document', List<PrintOption> options = const []}) Future<bool>
rawDataToPrinterAndStreamStatus(String printerName, Uint8List data, {String docName = 'Flutter Raw Data', Duration pollInterval = const Duration(seconds: 2), List<PrintOption> options = const []}) Stream<PrintJob>
resumePrintJob(String printerName, int jobId) Future<bool>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance PrintingFfi
Internal constructor for creating the singleton instance.
final