CodeMinion / another_brother

Another Brother Flutter SDK
BSD 3-Clause "New" or "Revised" License
21 stars 19 forks source link

P710BT only prints square labels #85

Open travishaagen opened 3 months ago

travishaagen commented 3 months ago

Hello!

I have a PT_P710BT with W24 label, am running on iOS, and am only able to print labels that are square (24x24). I'm trying to print shorter labels (12 mm).

I followed the advice from https://github.com/CodeMinion/another_brother/issues/40 and am rendering my own image. The final image dimensions are:

ui.PictureRecorder recorder = ui.PictureRecorder();
Canvas canvas = Canvas(recorder);
// ...
final printImage = await recorder.endRecording().toImage(1000, 500)

await printer.printImage(printImage);

None of the custom paper settings change the output.

Any suggestions?

CodeMinion commented 3 months ago

Hi @travishaagen ,

Thanks for reaching out about this. In order to print to one of the PT printer you'll need to specify the paper using the PT label. You may find an example here (https://github.com/CodeMinion/Demo-Another-Brother-Prime/blob/master/lib/main.dart#L559) for printing to the PT-P910BT model that you should be able to follow for your case. All you'll have to do is replace the printer model and the port to match the connection you are using along with a label matching the one you are using.

Hope this helps but don't hesitate to reach out if you run into any other issues.

travishaagen commented 3 months ago

These are the settings that result in square output for me. I've tried many other combinations too :)

    var printer = Printer();
    var printInfo = PrinterInfo();
    printInfo.printerModel = Model.PT_P710BT;
    printInfo.printMode = PrintMode.FIT_TO_PAGE;
    printInfo.isAutoCut = true;
    printInfo.isCutAtEnd = true;
    printInfo.isHalfCut = false;
    printInfo.port = Port.BLUETOOTH;
    printInfo.labelNameIndex = PT.ordinalFromID(PT.W24.getId());
    await printer.setPrinterInfo(printInfo);
CodeMinion commented 3 months ago

Hi @travishaagen ,

Thanks for the print settings. Could we trouble to share a picture of the print in order to get a better idea?

Thanks in advance,

Artur512 commented 5 days ago

Have the same issue on iOS: on the top is the result if resolution is normal, on the bottom if resolution is high. Image 2

full printer info settings:

  final printInfo = PrinterInfo(
    printerModel: Model.PT_P750W,
    printQuality: Platform.isIOS ? PrintQuality.NORMAL: PrintQuality.HIGH_RESOLUTION,
    isAutoCut: false,
    isHalfCut: true,
    isCutAtEnd: false,
    port: Port.NET,
    orientation: Orientation.LANDSCAPE,
    labelNameIndex: PT.ordinalFromID(PT.W24.getId()),
  )

Next issue is that iOS do not respect isAutoCut param. Cut label every image, Android works good.