ebanutsya
This commit is contained in:
@@ -17,16 +17,16 @@ class PrintingService {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
private async print(printer: string, type: string, bytes: Uint8Array): Promise<string> {
|
||||
private async print(printer: string, type: string, bytes: Uint8Array): Promise<boolean> {
|
||||
let response = await axios.post(`http://${this.apiUrl}:${this.port}/print/${printer}/${type}`, bytes.buffer);
|
||||
return response.data;
|
||||
return response.data.ok;
|
||||
}
|
||||
|
||||
public async printPdf(printer: string, pdfBytes: Uint8Array): Promise<string> {
|
||||
public async printPdf(printer: string, pdfBytes: Uint8Array): Promise<boolean> {
|
||||
return this.print(printer, "pdf", pdfBytes);
|
||||
}
|
||||
|
||||
public async printImage(printer: string, imageBytes: Uint8Array): Promise<string> {
|
||||
public async printImage(printer: string, imageBytes: Uint8Array): Promise<boolean> {
|
||||
return this.print(printer, "image", imageBytes);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user