Iterator<String> iter = states.keySet().iterator();
COSDictionary dic = new COSDictionary();
while( iter.hasNext() )
{
String name = (String)iter.next();
PDExtendedGraphicsState state = states.get( name );
dic.setItem( COSName.getPDFName( name ), state.getCOSObject() );
}
resources.setItem( COSName.EXT_G_STATE, dic );
}