Skip to content

printText() method not working #160

Description

@alexsusin

I have a Datecs DPP-350 printer with which I can't print text unless I put an image or a QR to print as well. Also, it only works randomly, I can't get it to always print what I want. It would also help me to know how to use the setPageRegion method. With this code everything explained above happens:

  window.DatecsPrinter.listBluetoothDevices(
    function (devices) {
      window.DatecsPrinter.connect(devices[0].address,
        function () {
          printSomeTestText();
        },
        function () {
          alert(JSON.stringify(error));
        }
      );
    },
    function (error) {
      alert(JSON.stringify(error));
    }
  );

  function printSomeTestText() {
    window.DatecsPrinter.printText("Demo", 'ISO-8859-1',
      function () {
        printQRCode();
      }
    );
  }

  function printQRCode() {
    window.DatecsPrinter.printQRCode(
      4,
      4,
      'http://giorgiofellipe.com.br',
      function () {
        alert('success!');
        window.DatecsPrinter.disconnect();
      },
      function () {
        alert(JSON.stringify(error));
      }
    );
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions