I'm unable to create a document with Xml (OpenXml) in my angular - typescript application - file gets created but opened shows "found unreadable content in document..." error. When I open the file in notepad, all I see is the Xml.
let blob = new Blob([openXmlString)], {type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'});
fileSaverService.save(blob, "Document.docx");
Using the same xml, I can create a document that actually works in C# using this code, trying to replicate this in my angular - typescript app
using (var doc = WordprocessingDocument.FromFlatOpcString(openXmlString))
{
doc.SaveAs("Document.docx").Close();
}
Could someone please let me know what I may be missing?
Thanks in advance.