Closed atmike closed 3 months ago
Hello Michael,
Thank you very much for the explanation, this is more clear now :-) And thank you very much for the bug fix and your time!
I did a cherry-pick of your commits related to the cell width & height. Regarding the events, I'm less inclined to merge it because all your modification could have been done prior to the parsing, by using a more powerful Html library such as AngleSharp or HtmlAgilityPack. Moreover, you are exposing internal stuff (like the Paragraph which is a bit hacky) which will slow me down to refactor without breaking changes. And I'm working on v3 which is a big rewrite of the parser. I hope you will understand my position but I still open to the discussion
The bug fix has been cherry-picked but I disagree with the "eventing" API
Hi Olivier here is the new request only for the bugfix for the height and width problem. Both Problems can be tested with the following snippet =>
As you can see, the cell has a height and a width specified in points. The first problem was in my eyes a copy and past error. In Line 1055 (your code) in the case UnitMetric.Point you calculate the Height in Pixel and not in Points
The secound Problem was, that the current implementation is ignoring the cell height. So you can't set the height of the row. What we do in Line 1050 (our code) is to get the Height of the cell and in Line 1149 to 1164 we set this height as Row height to the openxml element. This is because in word the row and not the cell has the heigth.
I hope this change is all right with you. Concerning the entry points I will contact you again in a separate request.
Best Regards from Trier
Michael
p.s. I thought you could make several pull requests - but apparently it doesn't work. So now the two new checkins have been added to this request. Both checkins extend the HtmlConverter by two events to edit the creation of a tag before and after. This time I implemented the implementation without the enum and only trigger the events.
Can you please check if the changes are OK for you. If you need further changes please let me know.