/** * @param s * @param fill * @return */ public Bitmap getImage(String s, int fill) { // check image has for image Bitmap image = images.get(s); if (image != null) { return image; } // check xobjects for stream Stream st = (Stream) library.getObject(xobjects, s); if (st == null) { return null; } // return null if the xobject is not an image if (!st.isImageSubtype()) { return null; } // lastly return the images. try { image = st.getImage(fill, this, true); } catch (Exception e) { logger.log(Level.FINE, "Error getting image by name: " + s, e); } if (image != null && !st.isImageMask()) { images.put(s, image); } return image; }