@bfast-system/bfast-hardware-tools-angular
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Bfast Hardware Tools

Build Status codecov npm version devDependency Status GitHub issues GitHub stars GitHub license

About

Installation

Install through npm:

npm install --save @bfast-system/bfast-hardware-tools-angular

Then include in your apps :

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { BfastHardwareTools } from '@bfast-system/bfast-hardware-tools-angular';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BfastHardwareTools.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Finally how to use:

import { Component, OnInit } from '@angular/core';
import { PrintingService, Printer } from '@bfast-system/bfast-hardware-tools-angular';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
})
export class AppComponent {
    title = 'app';
    
    constructor(private printing: PrintingService) {
        
    }

    ngOnInit() {
        this.printing.newDoc(Printer.Zebra, 203, 80.2);

        this.printing.text('Hello World !', 'Arial', 12, 'Regular', 10, 10);
        this.printing.text('Lorem ipsum !', 'Arial', 12, 'Regular', 10, 30);

        this.printing.image('https://i.pinimg.com/originals/74/3d/1f/743d1f161ffa538523e4d71addd0c646.jpg', 512, 512, 10, 50);

        this.printing.print((res) => {
            console.log(res);
            
            this.printing.status((status) => {
                console.log(status);
            });

        });
    }
}

Documentation

All documentation is auto-generated from the source via compodoc and can be viewed here: https://sdk.bfast-system.net/docs/angular/

License

MIT

Package Sidebar

Install

npm i @bfast-system/bfast-hardware-tools-angular

Weekly Downloads

7

Version

1.0.3

License

MIT

Unpacked Size

104 kB

Total Files

16

Last publish

Collaborators

  • vsalle