I’m doing a task which converting docx to html and the Mammoth library works well. However, I want to convert doc file to html but Mammoth doesn’t support it. I tried to convert doc to docx using docx library but it didn’t work
Here is the code that I tried
const docBuffer = await file.arrayBuffer();
const docString = new TextDecoder("utf-8").decode(docBuffer);
The result of docString is ��ࡱ� which is not what I’m expecting.
How can I get the string of doc file to pass it to the docx.Document method?
const docxFile = new docx.Document({
sections: [
{
properties: {},
children: [
new docx.Paragraph({
children: [
new docx.TextRun({
text: "sadas" //here
})
]
})
]
}
]
});