When doing “getHTMLContent” from a plugin, I get the font size in em instead of pt.
Example, If a font is set to ‘Arial 11’, the getHTMLContent will return
However, re-injecting it with “PasteHtml”, may set the font size to ‘Arial 10.5’, specially if it has other styles as underline.
I did dig into the code and I found that in all cases it is the function “CorrectFontSize” which is been called for that.
My question is, what is the need to switch from ‘pt’ to ‘em’ the size which will cause rounding issues?
Document Server version: 7.3 & 7.4
Installation method: docker, web
I don’t quite understand what is ‘getHTMLContent’, can you provide more details? Is that a method?
Eventually, you can check out sample plugin Get and paste html as a reference for your code:
Hello @Constantine ,
Sorry for “getHTMLContent” (my own code ), what i meant was
I checked out the plugin, however it uses “initOnSelectionChanged”, If I print the text is received as argument in the init function I get :
But when doing GetFileHTML,
where the font-size changed from 11pt to 0.95em
Even worse, the plugin afterwards get 0.95em, I suspect that the “CorrectFontSize” is setted up afterwards.
Thank you for the information. We are analyzing the situation, I will update the thread once any news come up.
By the way, is it possible to share example for your plugin so we can run test with it also?
We did some tests and found out that method PasteHtml incorrectly interpretates font size in
em unites. We registered this behavior as a bug and have already started working on it.
Thank you for pointing to it.