1.0.18 • Published 3 years ago

simple-electron-printer-and-thermalprinter v1.0.18

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

lastUpdate

added template for a ticket printer

use

const { createPrintWindow } =  require('simple-electron-printer-and-thermalprinter') 


createPrintWindow({

html: args.html,

cssUrl:  '../../resources/css/tablas-printer.css',

css: args.css,

mainWindow: win,

sheetSize:'A3',
printerName: 'epson'

config: ['timePrinter', 'hiddenWindow']

})

thermalprinter Use

if you use config 'thermalprint', It will look for a printer whose name includes 'tickets', if it finds it it will print silently, if not, it will remove the printing menu
const { createPrintWindow } =  require('simple-electron-printer-and-thermalprinter') 

createPrintWindow({

    html: createTicket(
        {
            'initial': [
                'My shop name', 'C.C. LAS ROZAS (MADRID) 28231 ','CIF :G28984567', '03-01-20 HORA: 18:12:15'
            ]
            ,
            'articles': [
                {
                    'quantity':12,
                    'product':'pantallasxxxxxxxdddddd',
                    'price':148
                },
                {
                    'quantity':3,
                    'product':'raton',
                    'price':14
                },
                {
                    'quantity':1,
                    'product':'teclado',
                    'price':5
                }
            ],
            'final': ['Thanks for your visit'],
            'imgUrl': 'imgurl'
        }
    ),
    printerName:'epson',
    config: ['thermalprinter']
    
})

config params

  • timePrinter: add time to print
  • hiddenWindow: do not show print preview
  • pdf: print as pdf in the printer folder of my documents "can add name param to de principal json"
  • finishFunction : function that launches after printing the pdf
  • thermalprinter : the objetive printer is thermalprinter

mandatory parameters

  • html
1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago