Using specific character ( ≤ , lesser equal ) in Document Template

0
Hello there, I am currently facing a quite interesting problem regarding Document Templates in Mendix. Using Version 9.18.4   I want to display the character ‘≤’ in my document. The character is in a String attribute of an entity that is being displayed in a DataGrid of the Template. However the Template is not able to render the character correctly, therefor it replaces it with a ‘#’.   Doing an xhtml render is not possible on a DataGrid, so I have tried to use a Template Grind with a dynamic label that has xhtml rendering on. Same Issue Tried to replace the ‘≤’ with both ‘&#08804;’ and ‘&le;’  First one has the same issue, a ‘#’ gets displayed, Second one throws an error “Caused by: org.xml.sax.SAXParseException: The entity "le" was referenced, but not declared.”   After some looking around I have found some .ent files in the runtime/lib folder that have the codes and numbers of xhtml characters written in it, but they seem to be doing nothing for the document creation?   The ‘≤’ is specified in the xhtml-symbol.ent file actually but it’s not being used. For testing purposes I tried to replace ‘<’ with ‘&lt;’ and the corresponding number which worked completely fine, but this one is part of the xhtml-special.ent file.   I also tried embedding different fonts to see if that might be the issue but same issues occur.   So, my question is now how can I display the ‘≤’ in the dynamic label? Is there a way to embedd the xthml-symbol.ent file somewhere, like maybe in the fop.xconf file?
asked
2 answers
0

I found a userlib --> commons-text-1.10.0 here --> https://commons.apache.org/proper/commons-text/download_text.cgi

Downlaoded the jar file and inserted it in my user lib. Then I created a java action that I use to unescape the HTML -->

// BEGIN USER CODE

return StringEscapeUtils.unescapeHtml4(this.InputHTML_Unescaped);

// END USER CODE

where the static class is imported like this in the upperside of the code -->

import org.apache.commons.text.StringEscapeUtils;

 

I found a userlib --> commons-text-1.10.0 here --> https://commons.apache.org/proper/commons-text/download_text.cgi

Downlaoded the jar file and inserted it in my user lib. Then I created a java action that I use to unescape the HTML -->

// BEGIN USER CODE

return StringEscapeUtils.unescapeHtml4(this.InputHTML_Unescaped);

// END USER CODE

where the static class is imported like this in the upperside of the code -->

import org.apache.commons.text.StringEscapeUtils;

 

answered
-1

You should look into using a different font, like DejaVu, that supports your character. See documentation on how to add custom fonts in fop.xconf and also this forum post. I even posted a test project there that is still available.

answered