The encoding of the string shouldn't matter--as long as the character that's emitted into the PDF is the correct Unicode character and the font mapping is to a Unicode font, then it will work. The only way the encoding could matter is if you were manually constructing the bytes of the PDF, which you are not (because PDFBox does that for you).
If you are not using a Unicode font then you will need to know which font you are using and what character code from that font gives you the character you want. Cheers, E. On 5/9/13 12:52 PM, "Andreas Lehmkuehler" <[email protected]> wrote: > Hi, > > Am 09.05.2013 02:06, schrieb Buzzy Spain: >> Hi all, >> >> I need to add text to a pdf that includes a number of superscript and >> subscript characters. Is there a "right" way to do this? My assumption is >> that drawing the string at some location and then drawing the >> super/subscript at a reduced point size offset up or down is not best >> practice. It will certainly be a pain... > The PDF format doesn't have any concept of formatted text. So your description > is exactly what you have to do. > >> The data I have is coming from a java String (UTF-16). The String literal >> is being saved with an IDE that probably saves in a less preserving format >> (UTF-8?). I can change the data source if it makes my life easier. >> >> I am new to the world of PDFBox and the details of fonts so feel free to >> start at the beginning and drive slowly. :) > Have a look at [1], but be aware that the link will change, as our overhauled > website will go live in a few days. > >> Thanks, >> Buzzy > > BR > Andreas Lehmkühler > [1] http://pdfbox.apache.org/userguide/cookbook.html > -- Eliot Kimber Senior Solutions Architect, RSI Content Solutions "Bringing Strategy, Content, and Technology Together" Main: 512.554.9368 www.rsicms.com www.rsuitecms.com Book: DITA For Practitioners, from XML Press, http://xmlpress.net/publications/dita/practitioners-1/

