mobile-native-barcode-generator
Version:
Library to generate barcodes and qr codes natively using Kotlin and Swift, integrated with react native.
17 lines (16 loc) • 704 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = generateBarcode;
var _MobileNativeBarcodeGenerator = _interopRequireDefault(require("./MobileNativeBarcodeGenerator.js"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
async function generateBarcode(value, width, height) {
if (value.length > 80) {
throw new Error("Barcode value length must be less than 80 characters");
}
const returnValue = await _MobileNativeBarcodeGenerator.default.generateBarcode(value, width, height);
const finalReturn = `data:image/png;base64,${returnValue}`;
return finalReturn;
}
//# sourceMappingURL=generateBarcode.js.map