kakzaki / blue_thermal_printer

Working with thermal printer via bluetooth (Flutter)
MIT License
164 stars 205 forks source link

How to set image size on print #120

Closed Massau closed 2 years ago

Massau commented 2 years ago

Dear Kakzaki,

Thank you for creating this package, I was looking for one that would suit me in this functionality

I ask if in an update it will be possible to define the image size in the print, as it is currently possible to do this for texts, as shown in the example available in the documentation:

void _tesPrint() async {
    //SIZE
    // 0- normal size text
    // 1- only bold text
    // 2- bold with medium text
    // 3- bold with large text
    //ALIGN
    // 0- ESC_ALIGN_LEFT
    // 1- ESC_ALIGN_CENTER
    // 2- ESC_ALIGN_RIGHT
    bluetooth.isConnected.then((isConnected) {
    if (isConnected) {
        bluetooth.printNewLine();
        bluetooth.printCustom("HEADER",3,1);
        bluetooth.printNewLine();
        bluetooth.paperCut();
        }
    });
}

In an upcoming update, I suggest that these features be added: To be able to set the padding/print margin Be able to pass as a parameter whether the printer you are going to print is 50mm or 80mm and adjust the print size to adapt to the available space.

Thanks again.

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.