0.0.5 • Published 3 years ago

doka-label-print v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

DokaLabelPrint

Library for Doka Label-Printing. Connects to a SATO or ZPL Printer via BT and prints x amount of a specific Label (Return-Label, Picking-Label, Product-Label)

Requirements: -Angular: ^8.2.0, -Ionic: ^4.11.10, -pouchdb: 7.1.1, -cordova-plugin-file, -cordova-plugin-file-path, -cordova-plugin-bluetooth-serial, -cordova-plugin-barcode-scanner, -ngx-translate/core, -doka-logging

Usage

On Appstart execute function: initPrint(). This creates or loads a pouchdb entry for the printer-config.

import {DokaLabelPrintService} from "doka-label-print";

constructor(private dokaLabelPrintService: DokaLabelPrintService);

Printer-config object: public printerConfig: {_id: string, _rev: string, connectedPrinter: string}

Use to print Label for specific type public printLabel( printItems: any[], type: "printer" | "picking" | "product" | "return", amount = null )

To connect a printer without printing a Label: connectPrinter(null, null, null).then(code => {

});

List all BT devices nearby: public getDeviceList(): Promise<bluetoothDevice[]>

Saves printer-config manually: public savePrinterConfig()

Set image source for prodcut images if not "this.file.dataDirectory + "productImgs/"": public setImageSrc(src: string)

Disconnects and deletes printer: public disconnectPrinter()

Labels to add to Translation

"PRINT": "Print Packaging Labels", "ACTIVATE_BT": "Activate Bluetooth?", "ACTIVATE_BT_TEXT": "Should we activate Bluetooth on your device?", "PRINT_SUCCESSFUL": "Print successful!", "PRINT_SUCCESSFUL_TEXT": "Labels successfully printed", "PRINT_ERROR": "Print Error!", "PRINT_ERROR_TEXT": "There was an error while printing labels.", "TRYING_TO_CONNECT_TO_PRINTER": "Trying to connect to printer", "SCAN_PRINTER_QR": "Scan Printer QR-Code", "SCAN_PRINTER_QR_TEXT": "To connect your printer to your device, you have to scan the QR-Code located on your printer.", "SCAN": "Scan", "PRINTER_CONNECT_ERROR": "Connect Error!", "PRINTER_CONNECT_ERROR_TEXT": "Unable to connect to printer.", "NORMPACKAGING": "Normpackaging", "PRINTING": "Printing", "PRINT_AMOUNT": "Print amount", "CONNECT_PRINTER_MANUALLY": "Connect printer manually", "NEW_CAP": "NEW", "USED_CAP": "USED", "SALES_ORDER_NO": "Sales order no.", "CHECKED_BY": "Checked by", "CUSTOMER": "Customer", "CUSTOMER_NO": "Customer-no:", "PICKING_TICKET": "Picking ticket:", "SHIPMENT_DATE": "Shipment date:", "ADDRESS": "Address:", "PROJECT": "Project:", "NO": "No", "OK": "Ok", "CANCEL": "Cancel", "LOADING": "Loading", "PRINT_COLLI": "Print Colli",

// new for return labels "PRINT_RETURN_NO": "Return No", "PRINT_CUSTOMER": "Customer", "PRINT_PROJECT_NO": "Project No", "PRINT_PROJECT": "Project", "PRINT_RETURN_DATE": "Return Date", "PRINT_CR": "c&r plus", "NO": "No", "YES": "Yes",

Info

David Herzog 2020

0.0.5

3 years ago