directprint 1.0.1 copy "directprint: ^1.0.1" to clipboard
directprint: ^1.0.1 copied to clipboard

outdated

Directprint The plugin allows Flutter applications to raw print to Windows printers using the OpenPrinter/StartDocPrinter system functions, mainly for sending raw text and control codes to POS printers.

directprint #

Directprint The plugin allows Flutter applications to raw print to Windows printers using the OpenPrinter/StartDocPrinter system functions, mainly for sending raw text and control codes to POS printers.

The plugin is intended for the Windows platform.

Getting Started #

The Directprint() class allows you to send codes directly to a Windows printer with the help of the "print" method.

    Future<String?> print(String printer, String job, Uint8List data)

Call the "print" method with arguments:

String printer - Sistem printr nae 
String job - Specifying job name in print queue
Uint8List data - raw data bytes

The result of the call is a Future String with the following content:

"OK" - if the call ended without error
"ERROR:1" - Error: Opening Printer
"ERROR:2" - Error: Opening Document
"ERROR:3" - Error: Starting Page
"ERROR:4" - Error: Printing Count```

Installing #

  1. Add this package to your package's pubspec.yaml file as described on the installation tab

  2. Import the librarie

   import 'package:directprint/directprint.dart';

Example code #

    import 'package:directprint/directprint.dart';
    
    Future doPrint() async {
       // ...
       final _directprintPlugin = Directprint();
   
       // ...
       String data = "Direct print plugin test ...\n\n\n\n";
       Uint8List enctxt = Uint8List.fromList(data.codeUnits);
       
       String printer = 'unknown';
       String job = 'Invoice';
       
       String dpResult =
         await _directprintPlugin.print(printer, job, enctxt) ?? '';
   
       // ...
    }
3
likes
0
points
1.78k
downloads

Publisher

verified publisherfraktal.hr

Weekly Downloads

Directprint The plugin allows Flutter applications to raw print to Windows printers using the OpenPrinter/StartDocPrinter system functions, mainly for sending raw text and control codes to POS printers.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on directprint