public Map getColorants() throws IOException {
Map actuals = new HashMap();
COSDictionary colorants = (COSDictionary)dictionary.getDictionaryObject( COSName.getPDFName( "Colorants" ) );
if( colorants == null )
{
colorants = new COSDictionary();
dictionary.setItem( COSName.getPDFName( "Colorants" ), colorants );
}
for( COSName name : colorants.keySet() )
{
COSBase value = colorants.getDictionaryObject( name );
actuals.put( name.getName(), PDColorSpaceFactory.createColorSpace( value ) );
}
return new COSDictionaryMap( actuals, colorants );
}
This will get a map of colorants. See the PDF Reference for more details about
this attribute. The map will contain a java.lang.String as the key, a colorant name,
and a PDColorSpace as the value. |