У меня есть термопринтер диаметром 58 мм, подключенный через Bluetooth к моему приложению Flutter, но печать становится "полосчатой", когда я отправляю ее с поворотом в альбомную ориентацию.
как дела?
Future imprimirPdf(
Uint8List bytesPdf,
String mac,
) async {
List bytes = [];
var parametros = await _paramsService.getParams();
var colunas = parametros['parametros']['colunasimpressora'];
PaperSize papel = PaperSize.mm80;
if (colunas != null && colunas.isNotEmpty) {
if (int.parse(colunas) > 0 && int.parse(colunas) < 80) {
papel = PaperSize.mm58;
}
}
CapabilityProfile profile = await CapabilityProfile.load();
Generator generator = Generator(papel, profile);
bytes += await _pdf(generator, bytesPdf);
return imprimir(bytes, mac);
}
Future _pdf(
Generator generator,
Uint8List bytes,
) async {
List dadosBoleto = [];
var image = img.decodePng(bytes)!;
dadosBoleto += generator.imageRaster(image);
return dadosBoleto;
}```
the document is a converted pdf to image.
Подробнее здесь: https://stackoverflow.com/questions/793 ... ument-58mm