Hi Halvor,
Thank you for your interest in Syncfusion Products.
In AppendHTML(HTML to Doc) method, DocIO converts HTML DOM (document object
model) to DocIO DOM and then appends the converted object model to the source paragraph.
During this phase, if font information is not specified in the input html
string, default value is taken for the converted object model (paragraphs and
tables). To resolve this issue, kindly apply the paragraph style before calling
AppendHTML() or once after appending HTML we need to manually parse the
appended DocIO object model and specify font information directly. Please refer
the below code snippet for illustrating the same.
Code snippet:
paragraph =
section.AddParagraph()
paragraph.ApplyStyle(HTMLStyle.Name)
paragraph.AppendHTML('<strong>Test</strong>
One<br/>')
Please let us know if you have any other questions.
Regards,
Sivasubramanian
Hi Halvor,
Thank you for your interest in Syncfusion products.
The work around suggested by you with the HTML content contains font size defined inside the body style - font size attribute ("<body style=\"font-size: 8pt; font-family: Arial\">" + model.XmlContent + "</body>"") will work well in both InsertHTML and AppendHTML methods.
On an additional note, Both AppendHTML/InsertHTML (HTML to Doc) method, DocIO converts HTML DOM (document object model) to DocIO DOM and then appends/inserts the converted object model to the source paragraph. During this phase, if font information is not specified in the input html string, default value is taken for the converted object model (paragraphs and tables) causing the reported problem. Hence defining the font size inline in the input HTML string will result in expected output.
For more information, refer below UG documentation.
http://help.syncfusion.com/ug/asp.net/docio/default.htm#!documents/importingxhtml.htm
Please let us know if you have any questions.
Regards
Rajendran