Git Product home page Git Product logo

Comments (1)

patrickbussmann avatar patrickbussmann commented on August 16, 2024

I'll add some examples soon. Sorry.

Your file should look like:

import {Component} from '@angular/core';
import {ThermalPrinterPlugin} from 'thermal-printer-cordova-plugin/src';

declare let ThermalPrinter: ThermalPrinterPlugin;

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {
  constructor() {
    var text =
      '[L]\n' +
      '[C]<u><font size=\'big\'>ORDER N°045</font></u>\n' +
      '[L]\n' +
      '[C]================================\n' +
      '[L]\n' +
      '[L]<b>BEAUTIFUL SHIRT</b>[R]9.99e\n' +
      '[L]  + Size : S\n' +
      '[L]\n' +
      '[L]<b>AWESOME HAT</b>[R]24.99e\n' +
      '[L]  + Size : 57/58\n' +
      '[L]\n' +
      '[C]--------------------------------\n' +
      '[R]TOTAL PRICE :[R]34.98e\n' +
      '[R]TAX :[R]4.23e\n' +
      '[L]\n' +
      '[C]================================\n' +
      '[L]\n' +
      '[L]<font size=\'tall\'>Customer :</font>\n' +
      '[L]Raymond DUPONT\n' +
      '[L]5 rue des girafes\n' +
      '[L]31547 PERPETES\n' +
      '[L]Tel : +33801201456\n' +
      '[L]\n' +
      '[C]<barcode type=\'ean13\' height=\'10\'>831254784551</barcode>\n' +
      '[C]<qrcode size=\'20\'>http://www.developpeur-web.dantsu.com/</qrcode>';

    var data = {
      type: 'tcp',
      id: '192.168.1.99:9100',
      address: '192.168.1.99',
      port: '9100',
      mmFeedPaper: 200,
      dotsFeedPaper: 20,
      text: text
    };
    ThermalPrinter.printFormattedTextAndCut(data, function() {
      console.log('IMPRESO CORRECTAMENTE');
    }, function() {
      console.log('EROORRRR AL IMPRIMIR');
    });
  }
}

But as I said: I'll add some examples soon❗

from thermal-printer-cordova-plugin.

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.