Barcode CODE_128 using PrintHTML with Qz Tray

94 Views Asked by At

Good Day All,

Right now, i'm trying to print using HTML with Qz-Tray. Can i make a barcode on that template HTML. The Problem is, that HTML template is STRING so it can not be change it using Javascript and I'm Trying to use Libre Font 128 Font Family but still not working.

https://www.w3schools.com/howto/tryit.asp?font=Libre%20Barcode%20128 i want to use that library, in this

function printHTML() {
    var config = getUpdatedConfig();

    var colA = '<h2>*&nbsp; QZ Print Plugin HTML Printing &nbsp;*</h2>' +
            '<span style="color: #F00;">Version:</span> ' + qzVersion + '<br/>' +
            '<span style="color: #F00;">Visit:</span> https://qz.io/';
    var colB = '<img src="' + getPath() + '/assets/img/image_sample.png">';

    var printData = [
        {
            type: 'html',
            format: 'plain',
            data: '<html>' +
            '   <table style="font-family: monospace; border: 1px;">' +
            '       <tr style="height: 6cm;">' +
            '           <td valign="top">' + colA + '</td>' +
            '           <td valign="top">' + colB + '</td>' +
            '       </tr>' +
            '   </table>' +
            '</html>'
        }
    ];

    qz.print(config, printData).catch(displayError);
}

or this https://barcode-coder.com/en/barcode-jquery-plugin-201.html

0

There are 0 best solutions below