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.” }
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?
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:
Ignores unsupported tags and attributes, but inserts what it does understand.
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.