Problem:
Aspose complements HTML-Document on Loading with style informations. See below input- and output-html. Our concern is to overwrite the used default font (Times New Roman). How can this be achieved?
Sample Sourcecode:
FontSettings settings = FontSettings.getDefaultInstance();
settings.setDefaultFontName(“Arial”);
InputStream htmlInputStream = …;
LoadOptions loadOptions = new LoadOptions();
loadOptions.setFontSettings(settings);
loadOptions.setLoadFormat(LoadFormat.HTML);
Document document = new Document(htmlInputStream, loadOptions);
String result = document.toString(SaveFormat.HTML)
Input-HTML:
image.png (6.9 KB)
Resulting-HTML:
image.png (10.9 KB)