public void showText (final String text) throws IOException
  {
    if (!inTextMode)
    {
      throw new IllegalStateException ("Must call beginText() before showText()");
    }

    if (fontStack.isEmpty ())
    {
      throw new IllegalStateException ("Must call setFont() before showText()");
    }

    final PDFont font = fontStack.peek ();

    // Unicode code points to keep when subsetting
    if (font.willBeSubset ())
    {
      for (int offset = 0; offset < text.length ();)
      {
        final int codePoint = text.codePointAt (offset);
        font.addToSubset (codePoint);
        offset += Character.charCount (codePoint);
      }
    }

    COSWriter.writeString (font.encode (text), m_aOS);
    write ((byte) ' ');
    writeOperator ((byte) 'T', (byte) 'j');
  }
public void showText ( final String text ) throws IOException { if ( ! inTextMode ) { throw new IllegalStateException ( "Must call beginText() before showText()" ) ; } if ( fontStack . isEmpty ( ) ) { throw new IllegalStateException ( "Must call setFont() before showText()" ) ; } final PDFont font = fontStack . peek ( ) ; if ( font . willBeSubset ( ) ) { for ( int offset = 0 ; offset < text . length ( ) ; ) { final int codePoint = text . codePointAt ( offset ) ; font . addToSubset ( codePoint ) ; offset += Character . charCount ( codePoint ) ; } } COSWriter . writeString ( font . encode ( text ) , m_aOS ) ; write ( ( byte ) ' ' ) ; writeOperator ( ( byte ) 'T' , ( byte ) 'j' ) ; }
Shows the given text at the location specified by the current text matrix.

@param text
The Unicode text to show.
@throws IOException
If an io exception occurs.