This project has moved. For the latest updates, please go here.

font size lost

Mar 1, 2013 at 6:41 AM
Edited Mar 1, 2013 at 6:43 AM
html code like this:
Looks how cool is <font size="x-large"><b>Open Xml</b></font>.
      Now with <font color="red"><u>HtmlToOpenXml</u></font>, it nevers been so easy to convert html.
      <p>
           If you like it, add me a rating on <a href="http://notesforhtml2openxml.codeplex.com">codeplex<br /> </a>
      </p>
      <h1>
            heading 1 
       </h1>
       <span style="font-size: 22pt;">font 22pt</span>
       <hr />
when i export to .docx file, the tag <h1> and font-size in tag <span> did not show correcttly, how to solve this problem?
by the way, the image are not automatically downloaded and inserted inside the word document.
Apr 22, 2013 at 4:17 AM
i want to know too...
Coordinator
Aug 9, 2013 at 8:13 AM
It's fixed now. I was mis-reading the Font attribute. You can get the latest source code.
Sorry for delay
Jan 13, 2014 at 7:56 AM
Hello,
But how does it work for my exemple?

```
<br class="ibp-rteFontSize-5"/><span style="font-size: 16px">My Text </span></div>```
When I write ( in C#):
attrValue = en.StyleAttributes["font-size"];
            if (attrValue != null)
            {
                if (String.Compare(attrValue, "100%") != 0)
                {
                    if (attrValue.Contains("pt"))
                    {
                        attrValue = attrValue.Replace("pt", "");
                    }
                    if (attrValue.Contains("px"))
                    {
                        attrValue = attrValue.Replace("px", "");
                    }
                    styleAttributes.Add(new FontSize { Val = attrValue });
                }
The texte "My Texte" disapears.
Thanks in advance for your answers.
Coordinator
Jan 13, 2014 at 8:39 AM
Where is coming this code? Not from the library or from an very old version.
You need to transform your Html unit to OpenXml unit (there are not the same and not on the same scale).
Use the class HtmlFont to help you.

new FontSize { Val = "15" } could be valid but the text will be small. Check the zoom of your document.