Hi, Im trying to use c# to convert word to sfdt text to parse into the sync fusion editor, but the format of the word file is in isint the same as what is shown when the sfdt text passed into the sync fusion editor.
Heres the code im using:
public async Task<string> GetFileAsSfdtText(string fileId)
{
try
{
var wordBytes = await GetFileAsWord(fileId);
await using var stream = new MemoryStream(wordBytes);
var sfdtDocument = WordDocument.Load(stream, FormatType.Docx);
var sfdtText = JsonConvert.SerializeObject(sfdtDocument);
sfdtDocument.Dispose();
return sfdtText;
}
catch (Exception ex)
{
_logger.LogError(ex, "Unable to convert file to SFDT text");
throw;
}
}
Is this being done the wrong way? if so do we need to pass anything in to keep the same format the word file has? Thanks
The sdft file when displayed on the sync fusion editor looks like this below
as seen the file doesnt have any padding to the left, the bullet points are missing and theres no spacing between words, no formatting is being kept. can anyone help with this? Thanks