Percentage in width causes InsertHtml to throw FormatException

If I try to insert the html listed below using InsertHtml method ont the DocumentBuilder class I get the Exception listed below the html.
\r\n\r\n\r\n\r\n\r\n\r\n\r\n

Test
Test2

\r\n

\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n

123

System.FormatException
{“Input string was not in a correct format.” }

Hi,
We are working on this right at the moment This will be fixed very soon.

Will that fix also solve the following problem. When we try to put the following html code in word it returns the same error.
(regards and hoping)


This is

A test

For to

It works

This is

A test

See if

It works

This is

We will try our best.

I downloaded v3.3.2.0 and it looks like InsertHTML is working and any unsupported HTML tags/attributes are ignored. However, the exception is still raised, which is fine as long as that’s the expected behavior. Can you verify that this is the expected behavior?

Column and table widths on import are still not supported.

That’s fine, but I’m wondering what exactly Aspose.Word actually does regarding unsupported InsertHTML. I need to know in order to code for an expected behavior. It appears as if Aspose.Word does the following regarding InsertHTML:

  1. Ignores unsupported tags and attributes, but inserts what it does understand.
  2. Raises an exception.

Previously, Aspose.Word simply raised an exception without inserting. What is it actually doing with the current version?

Hello Aspose! We have the same problem. The problem is when we convert Word document with Aspose.Words component and after convert it back to Word, code throws exception after documentBuilder.InsertHTML method. The cause is evident. When using Style attiribute in tags (obviously generated by Word) and assigning border-left, border-top values etc. instead of just border, the error is generated. Sure, we could parse border-left, border-top away, but this is not the solution. InsertHTML should also recognize these CSS attributes. It’s according CSS2 standard.

Thank you in advance
Regards
Edusol

Hi
Thanks for your request. Please provide me the code and html that allows me to reproduce this problem.
Best regards.