/** * This will set the list of alternate color spaces. This should be a list of PDColorSpace * objects. * * @param list The list of colorspace objects. */ public void setAlternateColorSpaces(List list) { COSArray altArray = null; if (list != null) { altArray = COSArrayList.converterToCOSArray(list); } stream.setItem(COSName.getPDFName("Alternate"), altArray); }
private COSArray getRangeArray(int n) { COSArray rangeArray = (COSArray) stream.getDictionaryObject(COSName.getPDFName("Range")); if (rangeArray == null) { rangeArray = new COSArray(); stream.setItem(COSName.getPDFName("Range"), rangeArray); while (rangeArray.size() < n * 2) { rangeArray.add(new COSFloat(-100)); rangeArray.add(new COSFloat(100)); } } return rangeArray; }
/** * This will set the metadata stream that is associated with this color space. * * @param metadata The new metadata stream. */ public void setMetadata(COSStream metadata) { stream.setItem(COSName.getPDFName("Metadata"), metadata); }
/** * This will set the number of color components. * * @param n The number of color components. */ public void setNumberOfComponents(int n) { stream.setItem(COSName.getPDFName("N"), new COSInteger(n)); }