/** * Returns the entry as an appearance subdictionary. * * @throws IllegalStateException if this entry is not an appearance subdictionary */ public Map<COSName, PDAppearanceStream> getSubDictionary() { if (!isSubDictionary()) { throw new IllegalStateException("This entry is not an appearance subdictionary"); } COSDictionary dict = entry; Map<COSName, PDAppearanceStream> map = new HashMap<>(); for (COSName name : dict.keySet()) { COSBase value = dict.getDictionaryObject(name); // the file from PDFBOX-1599 contains /null as its entry, so we skip non-stream entries if (value instanceof COSStream) { map.put(name, new PDAppearanceStream((COSStream) value)); } } return new COSDictionaryMap<>(map, dict); } }
/** * Sets the colorant map. * @param colorants the map of colorants */ public void setColorants(Map<String, PDColorSpace> colorants) { COSDictionary colorantDict = null; if(colorants != null) { colorantDict = COSDictionaryMap.convert(colorants); } dictionary.setItem(COSName.COLORANTS, colorantDict); }
/** * Returns the role map. * * @return the role map */ public Map<String, Object> getRoleMap() { COSBase rm = this.getCOSObject().getDictionaryObject(COSName.ROLE_MAP); if (rm instanceof COSDictionary) { try { return COSDictionaryMap.convertBasicTypesToMap((COSDictionary) rm); } catch (IOException e) { LOG.error(e,e); } } return new Hashtable<>(); }
/** * {@inheritDoc} */ @Override public boolean isEmpty() { return size() == 0; }
/** * {@inheritDoc} */ @Override public boolean isEmpty() { return size() == 0; }
/** * Returns a map of colorants and their associated Separation color space. * @return map of colorants to color spaces, never null. * @throws IOException If there is an error reading a color space */ public Map<String, PDSeparation> getColorants() throws IOException { Map<String,PDSeparation> actuals = new HashMap<>(); COSDictionary colorants = (COSDictionary)dictionary.getDictionaryObject(COSName.COLORANTS); if(colorants == null) { colorants = new COSDictionary(); dictionary.setItem(COSName.COLORANTS, colorants); } for(COSName name : colorants.keySet()) { COSBase value = colorants.getDictionaryObject(name); actuals.put(name.getName(), (PDSeparation)PDColorSpace.create(value)); } return new COSDictionaryMap<>(actuals, colorants); }
.convertBasicTypesToMap((COSDictionary) dp); retval = new COSArrayList<Object>(map, dp, stream, COSName.F_DECODE_PARMS); .convertBasicTypesToMap((COSDictionary) array .getObject(i)));
/** * Sets the colorant map. * @param colorants the map of colorants */ public void setColorants(Map<String, PDColorSpace> colorants) { COSDictionary colorantDict = null; if(colorants != null) { colorantDict = COSDictionaryMap.convert(colorants); } dictionary.setItem(COSName.COLORANTS, colorantDict); }
/** * {@inheritDoc} */ @Override public boolean isEmpty() { return size() == 0; }
retval = new COSDictionaryMap<>( actualMap, map );
.convertBasicTypesToMap((COSDictionary) dp); retval = new COSArrayList<Object>(map, dp, stream, COSName.DECODE_PARMS); .convertBasicTypesToMap((COSDictionary) array .getObject(i)));
/** * Sets the colorant map. * @param colorants the map of colorants */ public void setColorants(Map<String, PDColorSpace> colorants) { COSDictionary colorantDict = null; if(colorants != null) { colorantDict = COSDictionaryMap.convert(colorants); } dictionary.setItem(COSName.COLORANTS, colorantDict); }
/** * Returns the entry as an appearance subdictionary. * * @throws IllegalStateException if this entry is not an appearance subdictionary */ public Map<COSName, PDAppearanceStream> getSubDictionary() { if (!isSubDictionary()) { throw new IllegalStateException(); } COSDictionary dict = (COSDictionary) entry; Map<COSName, PDAppearanceStream> map = new HashMap<COSName, PDAppearanceStream>(); for (COSName name : dict.keySet()) { COSBase value = dict.getDictionaryObject(name); // the file from PDFBOX-1599 contains /null as its entry, so we skip non-stream entries if (value instanceof COSStream) { map.put(name, new PDAppearanceStream((COSStream) value)); } } return new COSDictionaryMap<COSName, PDAppearanceStream>(map, dict); } }
/** * Returns the role map. * * @return the role map */ public Map<String, Object> getRoleMap() { COSBase rm = this.getCOSObject().getDictionaryObject(COSName.ROLE_MAP); if (rm instanceof COSDictionary) { try { return COSDictionaryMap.convertBasicTypesToMap((COSDictionary) rm); } catch (IOException e) { LOG.error(e,e); } } return new Hashtable<String, Object>(); }
/** * Returns the entry as an appearance subdictionary. * * @throws IllegalStateException if this entry is not an appearance subdictionary */ public Map<COSName, PDAppearanceStream> getSubDictionary() { if (!isSubDictionary()) { throw new IllegalStateException(); } COSDictionary dict = (COSDictionary) entry; Map<COSName, PDAppearanceStream> map = new HashMap<>(); for (COSName name : dict.keySet()) { COSBase value = dict.getDictionaryObject(name); // the file from PDFBOX-1599 contains /null as its entry, so we skip non-stream entries if (value instanceof COSStream) { map.put(name, new PDAppearanceStream((COSStream) value)); } } return new COSDictionaryMap<>(map, dict); } }
/** * Returns the role map. * * @return the role map */ public Map<String, Object> getRoleMap() { COSBase rm = this.getCOSObject().getDictionaryObject(COSName.ROLE_MAP); if (rm instanceof COSDictionary) { try { return COSDictionaryMap.convertBasicTypesToMap((COSDictionary) rm); } catch (IOException e) { LOG.error(e,e); } } return new Hashtable<>(); }
/** * Returns a map of colorants and their associated Separation color space. * @return map of colorants to color spaces, never null. * @throws IOException If there is an error reading a color space */ public Map<String, PDSeparation> getColorants() throws IOException { Map<String,PDSeparation> actuals = new HashMap<>(); COSDictionary colorants = (COSDictionary)dictionary.getDictionaryObject(COSName.COLORANTS); if(colorants == null) { colorants = new COSDictionary(); dictionary.setItem(COSName.COLORANTS, colorants); } for(COSName name : colorants.keySet()) { COSBase value = colorants.getDictionaryObject(name); actuals.put(name.getName(), (PDSeparation)PDColorSpace.create(value)); } return new COSDictionaryMap<>(actuals, colorants); }
.convertBasicTypesToMap((COSDictionary) dp); retval = new COSArrayList<Object>(map, dp, stream, COSName.F_DECODE_PARMS); .convertBasicTypesToMap((COSDictionary) array .getObject(i)));
/** * Returns a map of colorants and their associated Separation color space. * @return map of colorants to color spaces, never null. * @throws IOException If there is an error reading a color space */ public Map<String, PDSeparation> getColorants() throws IOException { Map<String,PDSeparation> actuals = new HashMap<String, PDSeparation>(); COSDictionary colorants = (COSDictionary)dictionary.getDictionaryObject(COSName.COLORANTS); if(colorants == null) { colorants = new COSDictionary(); dictionary.setItem(COSName.COLORANTS, colorants); } for(COSName name : colorants.keySet()) { COSBase value = colorants.getDictionaryObject(name); actuals.put(name.getName(), (PDSeparation)PDColorSpace.create(value)); } return new COSDictionaryMap<String, PDSeparation>(actuals, colorants); }
.convertBasicTypesToMap((COSDictionary) dp); retval = new COSArrayList<Object>(map, dp, stream, COSName.F_DECODE_PARMS); .convertBasicTypesToMap((COSDictionary) array .getObject(i)));