We use Aspose.Words component to convert our word file into html file. However, the single quote character and double quote in the source word file is changed to a different special character in the target html file. This converted character shows up in browser as question mark. how can I resolve it?
Following is our conversion code:
public IActionResult GetFirstFile()
{
SetLicence();
var dir = @"C:\Aspose";
var Source = new Aspose.Words.Document(System.IO.Path.Combine(dir, "Res.docx"));
MemoryStream stream = new MemoryStream();
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html)
{
ExportTextInputFormFieldAsText = true,
ExportImagesAsBase64 = true,
CssStyleSheetType = CssStyleSheetType.Embedded,
ExportFontsAsBase64 = true,
ExportPageMargins = true,
ExportShapesAsSvg = true,
HtmlVersion = HtmlVersion.Html5,
UseHighQualityRendering = true,
ExportTocPageNumbers = true,
ExportRelativeFontSize = true,
ExportDocumentProperties = true,
};
options.ExportHeadersFootersMode = ExportHeadersFootersMode.PerSection;
Source.Save(stream, options);
var html = Encoding.ASCII.GetString(stream.ToArray());
ViewBag.HTML = html;
return View();
}
also attached the document file. pls checkRes.docx (14.6 KB)