Coder Social home page Coder Social logo

Comments (2)

thon-ju avatar thon-ju commented on July 17, 2024

@nletech 谢谢你的关注,由于安卓和ios的sdk差异较大,暂不考虑增加太复杂的方法;
对于复杂的布局及图形,建议使用打印图片的方式,思路如下:
1、在打印预览界面进行复杂布局
2、使用[screenshot] 组件生成截图
3、使用打印托盘方式
示例参考

File image = await screenshotController.capture(pixelRatio: 5);
List<int> imageBytes = await image.readAsBytes();
String base64Image = base64Encode(imageBytes);

List<LineText> list = List();
list.add(LineText(type: LineText.TYPE_IMAGE, content: base64Image, 
                        align: LineText.ALIGN_CENTER, linefeed: 1));
await bluetoothPrint.print(list);

from bluetooth_print.

mjl0602 avatar mjl0602 commented on July 17, 2024

作者你好,如果打印整个widget的截图,打印机反应会非常慢。目前打印70*110尺寸的标签,打印一张需要30秒才能打印出来。

根据我们目前的测试,即使是打印全空白的widget,只要尺寸是70*110,就一定需要30秒才能打印出来。

所以想问一下,是机器的问题还是代码的问题,是否有能更快打印的打印机?

打印机型号:佳博3120TU
代码如下

    list1.add(LineText(
      type: LineText.TYPE_IMAGE,
      x: 8,
      y: 6,
      width: 530,
      content: base64Image,
    ));

from bluetooth_print.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.