Does in angular do we have any library ?
i was looking for some examples but i didn’t found any.
I have found a library ngx-doc-viewer it has a url but i have base64 which i need to transform to word document. So i’m looking for some better solution.
convertAndDownload(base64Data: string, fileName: string) {
const byteCharacters = atob(base64Data);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray], { type: 'application/msword' });
saveAs(blob, fileName + '.doc');
}
Above code has saveAs method but i’m looking for some preview of word document.