js2jprint
v0.0.2-c
Published
Angular Javasript 2 Java print without preview. automatically JSON.stringify fix folder import
Downloads
12
Readme
Angular Javasript 2 Java print without preview. automatically JSON.stringify fix folder import
Import Module
first import module using :
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { JS2JPrintModule } from 'js2jprint/core'
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
JS2JPrintModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Usage
Example
import { Component } from '@angular/core';
import { JS2JPrint, OPrint } from 'js2jprint/core'
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'JS2JPrint';
constructor(private jsPrint : JS2JPrint){
}
print(){
let oprint : OPrint = {
data : this.data,
printer : 'EPSON TM-T82 Receipt',
type : 'pdf'
}
this.jsPrint.print(oprint);
}
//data : base64
}