private PDFObject findResource(String name, String inDict)
            throws IOException {
        if (inDict != null) {
            PDFObject in = resources.get(inDict);
            if (in == null || in.getType() != PDFObject.DICTIONARY) {
                throw new PDFParseException("No dictionary called " + inDict + " found in the resources");
            }
            return in.getDictRef(name);
        } else {
            return resources.get(name);
        }
    }