1

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

Avian Driyanto
  • 93
  • 2
  • 11
  • 1
    QZ Tray uses JavaFX for HTML and fonts can be tricky to get right, more info here: https://groups.google.com/g/qz-print/c/8WJKPrRlCYE/m/CwpZE-LCAwAJ. In regards to HTML template string, that should be workable. Can you please update the question with sample code to work from and what you're trying to achieve? – tresf Jan 12 '23 at 07:54
  • Thanks, i can figure it out. Thanks for the Link mate. – Avian Driyanto Jan 12 '23 at 08:44

0 Answers0