Exception raised by InsertHTML: Input string was not in a correct format

Hi,

I am also having a similar issue at present with v3.5.1.0 of Aspose.Words.

When using the .InsertHtml method of the document builder, I am receiving an exception :

[FormatException: Input string was not in a correct format.]
System.Number.ParseDouble(String s, NumberStyles style, NumberFormatInfo info) +0
System.Double.Parse(String s, NumberStyles style, IFormatProvider provider) +208
ӓ.ө.Ӽ(String ӝ)
ӓ.ө.ӵ(String ӝ)
ӓ.ө.set\_Ӕ(String ӝ)
ӓ.ө..ctor(String cssValue)
ӓ.Ә.set\_Ӕ(String ӝ)
ӓ.Ә..ctor(String cssStyle)
ᚨ.ᚿ.ᛃ(String ᛁ, ParagraphFormat ᛄ)
ᙽ.ᙼ.ᚙ(֧ ո)
ᙽ.ᙼ.ᚗ(֧ ո, Boolean ᚎ)
ᙽ.ᙼ.ᚏ(֧ ո, Boolean ᚎ)
ᙽ.ᙼ.ᚍ(֧ ո, Boolean ᚎ)
ᙽ.ᙼ.ᚊ(֧ ո)
ᙽ.ᙼ.ᚊ(֧ ո)
ᙽ.ᙼ.ᚊ(֧ ո)
ᙽ.ᙼ.ᚋ(Գ ᚌ)
ᙽ.ᙼ.ᚉ(String դ)
Aspose.Words.DocumentBuilder.InsertHtml(String html)

This occurs when using HTML that contains MARGIN settings, such as :

style='MARGIN: 0cm 0cm 25pt;'

Is there a fix / workaround / update available for this issue?

Regards

Jason.

Centimeters are not supported during HTML import. Only points are supported so far.

style='MARGIN: 0pt 0pt 25pt;' will work ok in your case.

We are going to add richer support of HTML import later this year.

Best regards,

Vladimir,

Thanks for your prompt response on this issue. I’ve implemented a simple RegEx filter to take care of this issue in our codebase for the time being.

However, with subsequent testing I have noticed that there are ‘other’ elements that also cause an exception (… such as “tab-stops:” which tripped me up this morning …).

I’m looking forward to the updated version of Aspose.Words “later this year”.

Regards

Jason.

Please attach here all HTML snippets that cause exception. We will try to fix them eventually.

Best regards,

I understand the complexity involved with rendering and dealing with HTML tags in word. However, we have been waiting since last year for Improvement on this (I can provide you links to older requests in this forums). From the forum posts, its clear that many users are having similar issues with HTML import functionality of Aspose.words.

Please make this a priority for upcoming HOTFIX release! Once again, we always appreciate your prompt response in terms of providing work around.

Thanks in advance!

Yes, we are aware of our HTML import limitations and the difficulties it imposes on our customers. We will try to fix what can be fixed as soon as possible. But full-scale HTML import support requires an extremely large piece of work to be done. We are planning to do this as soon as our schedule will permit.

Thanks for understanding.

hello. i am a newcomer to this problem (“System.FormatException: Input string was not in a correct format.”) related to “MARGIN: 0cm:”.

has this been fixed? if so, with which release?

unfortunately, our application uses a third-party utility which generates formatted content (stored as HTML). so that utility creates content that contains “MARGIN: 0cm:” and then Aspose.Word chokes on it… :frowning:

thanks in advance for any info.

We will try to fix this issue as soon as possible. Thanks for drawing our attention to it.

Best regards,