Hello, while testing ticket WORDSJR-313 with the ALLOW_HTML_LISTS parameter (Aspose 23.10.2), I noticed that the original font (in my case, Arial) is set to TimesNewRoman in the output. Could you please check this? I’ve attached a sample XmlHtmlFormat6.zip file. Thank you in advance.
Best regards, Achim
XmlHtmlFormat6.zip (22.5 KB)
@ohmstede
It seems that you are experiencing an issue with the font rendering when using the ALLOW_HTML_LISTS
parameter in Aspose.Words. Specifically, the output is defaulting to Times New Roman instead of the expected Arial font.
To address this issue, you can try the following steps:
-
Ensure Font Availability: Make sure that the Arial font is installed and available on the system where the Aspose.Words library is running. If the font is not available, Aspose.Words may fall back to a default font like Times New Roman.
-
Use HtmlSaveOptions: When saving your document to HTML, you can utilize the HtmlSaveOptions
class to specify how fonts should be handled. For example, you can set the ExportFontResources
property to true
to ensure that font resources are included in the output.
Here is a sample code snippet demonstrating how to set this up:
Document doc = new Document("your-document.docx");
HtmlSaveOptions saveOptions = new HtmlSaveOptions
{
ExportFontResources = true,
CssStyleSheetType = CssStyleSheetType.External
};
doc.Save("output.html", saveOptions);
-
Check for Font Resolution: If you are still facing issues, consider using the ResolveFontNames
option in HtmlSaveOptions
. This can help in resolving font names correctly during the conversion process.
Example:
HtmlSaveOptions saveOptions = new HtmlSaveOptions
{
ResolveFontNames = true
};
-
Review Documentation: For more detailed information on handling fonts and HTML lists, you may want to refer to the Aspose.Words documentation or examples related to HtmlSaveOptions
.
If the problem persists after trying these steps, please provide additional details or share the sample XML file you mentioned, so we can further investigate the issue.
Feel free to reach out if you have any more questions or need further assistance!
Unfortunately, the tips from Professionalize.Discourse don’t help. The problem only occurs with HTML lists using the ALLOW_HTML_LISTS parameter.
@ohmstede
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSJR-394
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.