I'm involved in a project where we generate pdf-files using iText. I want to generate superscipt text and I know that methods exists for converting chunks of text to superscript however, I am in a situation where it is desirable to decide based on the input whether or not a piece of text should be superscript or not. An optimal solution would be something like:
2<superscript>nd</superscript> to generate the text "2nd".
Is this, or anything like this possible?
It is worth noting that I do not write code directly against iText, there are layers between. This is why I need to decide what is superscript and not based on the input.
If you can't modify the code that's using iText, then no, there's no way. iText doesn't parse the text you put in a
In order to get a similar behaviour to what you want to achieve, you would need to do HTML to PDF conversion, with iText's companion XMLWorker for example.