title: How to test ticket before printing without physical printing using ESC_POS_PRINTER package on flutter
body: <p>I'm using <a href="https://pub.dev/packages/esc_pos_bluetooth" rel="nofollow noreferrer">esc_pos_bluetooth</a> in my flutter application , i don't wan't to spend a paper every time i test print a ticket , is there anyway to export the ticket a PDF or image to be able to check it without burning a paper ? here is my code : </p>
  
  <pre class="lang-dart prettyprint-override"><code>class PrintingServices {
    PrinterBluetooth printer;
    MoneyCollectingTicket moneyCollectingTicket;
  
    PrintingServices({this.moneyCollectingTicket});
  
    Ticket prepareMoneyCollectionData() {
      final Ticket ticket = Ticket(PaperSize.mm80);
  
      ticket.text( "Order time: ${moneyCollectingTicket.date}",
          styles: PosStyles(codeTable: PosCodeTable.westEur));
      ticket.text('Special 2: blåbærgrød',
          styles: PosStyles(codeTable: PosCodeTable.westEur));
  
      ticket.text('Bold text', styles: PosStyles(bold: true));
      ticket.text('Reverse text', styles: PosStyles(reverse: true));
      ticket.text('Underlined text',
          styles: PosStyles(underline: true), linesAfter: 1);
      ticket.text('Align left', styles: PosStyles(align: PosAlign.left));
      ticket.text('Align center', styles: PosStyles(align: PosAlign.center));
      ticket.text('Align right',
          styles: PosStyles(align: PosAlign.right), linesAfter: 1);
  
      ticket.text('Text size 200%',
          styles: PosStyles(
            height: PosTextSize.size2,
            width: PosTextSize.size2,
          ));
  
      ticket.feed(2);
      ticket.cut();
      return ticket;
    }
    Future&lt;void&gt; printMoneyCollectionData() async {
      PrinterBluetoothManager printerManager = PrinterBluetoothManager();
      printerManager.scanResults.listen((printers) async {
        printer = printers[0];
      });
      printerManager.startScan(Duration(seconds: 4));
      printerManager.selectPrinter(printer);
      final PosPrintResult res = await printerManager.printTicket(prepareMoneyCollectionData());
      print('Print result: ${res.msg}');
    }
  }
  </code></pre>
  
  <p>As you see this code finds a physical printer , what i need to change to export it to a file ?</p>