TransWikia.com

Changing react barcode format

Stack Overflow Asked by mig_08 on November 22, 2021

I am currently using the react-barcode package. It is currently using the format="CODE128" format, I needed to change it to use the Code 39 Barcode Font. How to I import the font to my react project and use it in the react-barcode component. If its not possible is there any other components I can use to achieve this.

Code:

import React, { Component } from 'react';
import Barcode from 'react-barcode';

 class Posts extends Component { 
     render () {
         return (
           <div>
               <Barcode value="http://github.com/kciter" />
           </div>
         );
     }
 }

 export default (Posts);

Display of the
code128 barcode

One Answer

React-barcode doesn't use a barcode font at all.

You can just, following the docs, set format="CODE39".

<Barcode value="123456" format="CODE39" />

Answered by AKX on November 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP