feat: barcodes printing
This commit is contained in:
11
src/utils/base64ToBlob.ts
Normal file
11
src/utils/base64ToBlob.ts
Normal file
@ -0,0 +1,11 @@
|
||||
function base64ToBlob(base64: string, type: string) {
|
||||
const binaryString = window.atob(base64);
|
||||
const len = binaryString.length;
|
||||
const bytes = new Uint8Array(len);
|
||||
for (let i = 0; i < len; ++i) {
|
||||
bytes[i] = binaryString.charCodeAt(i);
|
||||
}
|
||||
return new Blob([bytes], { type });
|
||||
}
|
||||
|
||||
export default base64ToBlob;
|
||||
Reference in New Issue
Block a user