Can I generate superscipt in iText using input only?

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.

Answer:1

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 Chunk.

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.

Answer:2

I am using Spring boot. I want to check which logging implementation is printing the message - I know with Spring boot default is Logback, and I have excluded it as mentioned in this post so mostly ...

I Wonder if there is any anyway of loading a template dynamically using playframework2 and scala using reflection. In play 1.x i used to do something like following: public static void template(...

I have design requirement to be able to save an IPv6 address in a decimal format. In java I have BigInteger that can hold 40 digit number and Oracle takes it via JDBC driver just fine. How can do ...

I want to check if a string: String s = "a=182 b=41 c=72", contains only: a b c, with their respective values, but they can occur in random order. How do I go about doing this? I have tried doing the ...