react-native-bluetooth-serial icon indicating copy to clipboard operation
react-native-bluetooth-serial copied to clipboard

How I Print text in bold

Open mtahir08 opened this issue 8 years ago • 6 comments

I want to print some values in bold. Can anyone knows how I can do this. Thanks

mtahir08 avatar Mar 10 '18 14:03 mtahir08

@mtahir08 did you got a solution for this

VyankeshH avatar Apr 05 '18 14:04 VyankeshH

@VyankeshH I did it using escpos-xml package. https://www.npmjs.com/package/escpos-xml

But now I am facing issue in auto cut paper.

mtahir08 avatar Apr 05 '18 14:04 mtahir08

undefined is not a function(evaluating '_escposXml.EscPos.getBufferXML(xml)') I got this type of error when I am trying with this library.Do you have any solution for this??

VyankeshH avatar Apr 06 '18 07:04 VyankeshH

@mtahir08 did you got qrcode using this.

https://www.npmjs.com/package/escpos-xml

VyankeshH avatar Apr 06 '18 12:04 VyankeshH

import { EscPos } from 'escpos-xml';
 const xml = `
    <?xml version="1.0" encoding="UTF-8"?>
    <document>
        <line-feed />
        <align mode="center">
            <bold>
                <text-line size="1:0">{{name}}</text-line>
            </bold>
            <line-feed />
            <small>
                <text-line size="1:0">---------------------</text-line>
                <text-line size="1:0">Dine-Inn</text-line>
                <text-line size="1:0">---------------------</text-line>
            </small>
            <line-feed />
            <text-line>Date & Time: {{moment date format="DD/MM/YYYY HH:MM"}} </text-line>
        </align>
          <line-feed />
    </document>
  `      
    const data = {
       name : 'Tahir' ,
      date:new Date()
    }

    const buffer_data = EscPos.getBufferFromTemplate(xml, data);

@VyankeshH Here is sample code. No I yet not use qrcode.

mtahir08 avatar Apr 06 '18 15:04 mtahir08

@mtahir08 I got the result,But I didn't got table with this,Did you have any reference for this. Thank you

VyankeshH avatar Apr 07 '18 05:04 VyankeshH