directprint

Creator: coderz1093

Last updated:

0 purchases

directprint Image
directprint Images

Languages

Categories

Add to Cart

Description:

directprint

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)
copied to clipboard
Call the "print" method with arguments:
String printer - Sistem printer name
String job - Specifying job name in print queue
Uint8List data - raw data bytes
copied to clipboard
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```
copied to clipboard
Installing #


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


Import the librarie


import 'package:directprint/directprint.dart';
copied to clipboard
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 = 'POS-58';
String job = 'Invoice';

String dpResult =
await _directprintPlugin.print(printer, job, enctxt) ?? '';

// ...
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.