public void setPrefix ( String key , String prefix ) { PdfName fieldname = new PdfName ( key ) ; PdfObject o = get ( fieldname ) ; if ( o == null ) throw new IllegalArgumentException ( "You must set a value before adding a prefix." ) ; PdfDictionary dict = new PdfDictionary ( PdfName . COLLECTIONSUBITEM ) ; dict . put ( PdfName . D , o ) ; dict . put ( PdfName . P , new PdfString ( prefix , PdfObject . TEXT_UNICODE ) ) ; put ( fieldname , dict ) ; }
Adds a prefix for the Collection item . You can only use this method after you have set the value of the item .