Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When i print image its not starting from next label even given proper width and height of label size #153

Open
patelnirav48 opened this issue May 19, 2023 · 1 comment

Comments

@patelnirav48
Copy link

Below is the code to set label width and height with gap but after printing label not goes to next label position.

Map<String, dynamic> config = Map();
config['width'] = 40; // 标签宽度,单位mm
config['height'] = 30; // 标签高度,单位mm
config['gap'] = 2; // 标签间隔,单位mm

  final bytes = await File(imagePath).readAsBytes(); // Uint8List
  final data = bytes.buffer.asByteData(); // ByteData

  List<LineText> list = [];

  List<int> imageBytes =
      data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
  String base64Image = base64Encode(imageBytes);
  list.add(LineText(
    type: LineText.TYPE_IMAGE,
    x: 0,
    y: 0,
    width: 320,
    content: base64Image,
    align: LineText.ALIGN_CENTER,
  ));

  await bluetoothPrint.printLabel(config, list);
@ssdeen
Copy link

ssdeen commented Aug 4, 2023

Same issue, please let me know if you get any update on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants