You can take a look at the package that exists for angular 1.5 and adapt it to angular 5: https://github.com/allansli/angular-barcode-febraban#readme
Use the source:
https://github.com/allansli/angular-barcode-febraban/blob/master/assets/fonts/BarcodeInterleaved2of5.ttf
Create a font class:
@font-face {
font-family: "BarcodeInterleaved2of5";
src: url("../fonts/BarcodeInterleaved2of5.ttf") format("truetype");
}
.barcodei2of5 {
font-family: "BarcodeInterleaved2of5";
font-size: 200px;
}
Use the function that generates the sequence interpreted by the source:
function generateBarcodeSequence(barcode) {
var barcodeSequence = "";
if (barcode.length > 0 &&
barcode.length % 2 === 0) {
for (var index = 0; index < barcode.length; index = index + 2) {
var item = Number(barcode.substr(index, 2));
var charCode;
if (item <= 49) {
charCode = item + 48;
}
else {
charCode = item + 142;
}
barcodeSequence = barcodeSequence + String.fromCharCode(charCode);
}
barcodeSequence = "(" + barcodeSequence + ")";
}
return barcodeSequence;
}
Finally you encapsulate in a component of Angular 5 and use in your screens.