@bfast-system/bfast-hardware-tools-angular
v1.0.3
Published
[![Build Status](https://travis-ci.org/vsalle/bfast-hardware-tools-angular.svg?branch=master)](https://travis-ci.org/vsalle/bfast-hardware-tools-angular) [![codecov](https://codecov.io/gh/vsalle/bfast-hardware-tools-angular/branch/master/graph/badge.svg)]
Downloads
18
Maintainers
Readme
Bfast Hardware Tools
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