I use DocumentModel.Load() with the file path or in case of working with mails I use DocumentModel.Content.End.LoadText() with the text as string and LoadOptions.HtmlDefault. The document is then saved as Pdf with DocumentModel.Save() or converted to images by saving it pagewise with DocumentModel.GetPaginator().Pages and DocumentModelPage.Save().
I am using GemBox.Bundle in version 47.0.1024 in a .net472 Application.
This is a specific edge case that occurs because your <tbody> content doesn’t contain a table row, so it ends up being moved outside of it. However, in the case where you’re missing <html> (or <body>) there is no parent element where that invalid <tbody> content could be moved into.
using the table row tags helps, but I don’t edit the contents in my application’s general workflow. So adding tags is not my preferred solution. Is there any way to handle this within the document loading process, for example ensuring that a document contains valid HTML content when it is loaded with HtmlLoadOptions?
What exactly do you mean by that?
Do you mean that GemBox.Document should repair any HTML irregularity it encounters.
Note that GemBox.Document does try to do that, but I’m afraid some errors are more difficult to recover then others. Or better said, it can be challenging to have the same “repair” behavior as modern browsers have for some of those irregularities.
Nevertheless, we’ll investigate this context further.
I was thinking about something like a check for the standard HTML document start tags (as or ) and some sort of exception or note if they are missing completely. But I am not sure if this behaviour causes more problems than it solves, as these tags are not required for mails with HTML body (this is the context in which the problem originally occurred).
Newest version of GemBox.Bundle is working for the case of HTML documents, thank you!
But in case of loading the HTML body of mails (which had the problem of being shown empty before) to a document I received a NullReferenceException.
I am using GemBox.Bundle v. 47.0.1036 and the following statement:
var documentModel = new DocumentModel();