I have been trying to create PDF files using Itext PDF writer. I have found that Superscript (0,4,5,6,7,8,9) and Subscript (0,1,2,3,4,5,6,7,8,9) are not allowed in the default font. Only Superscript 1,2,3 are allowed in PDF texts in the default setting.
A String in my PDF contains subscript and superscript characters, is there a way i can display them in PDF?
I searched and found:
- setTextRise() method is used to change the displacement of the text with respect to the current line, I cannot use it as i don't know which characters are to super/sub scripted.
- Is there a setting to change the encoding/font of the text to UTF-8, so that it allows all the unicode symbols?
Or some other way, because i have to show chemical symbols like H₂SO⁴, O₂ etc.
It'd be of great help, thanks!