public Integer size() { return this.base != null ? this.base.size() : null; }
/** * Get all values of the dictionary */ private List<CosObject> getValues() { List<CosObject> list = new ArrayList<>(this.baseObject.size().intValue()); for (COSObject value : this.baseObject.getValues()) { if (value != null) { list.add(getFromValue(value.get())); } } return Collections.unmodifiableList(list); }
/** * Get all keys of the dictionary */ private List<CosName> getKeys() { List<CosName> list = new ArrayList<>(this.baseObject.size().intValue()); for (ASAtom key : this.baseObject.getKeySet()) { if (key != null) { COSBase name = COSName.fromValue(key); list.add((CosName) getFromValue(name)); } } return Collections.unmodifiableList(list); }
/** * @return The size of the Widths array; null if the Widths array is not * present or has invalid type. */ @Override public Long getWidths_size() { COSObject widths = this.pdFont.getWidths(); if (widths.empty() || widths.getType() != COSObjType.COS_ARRAY) { return null; } return Long.valueOf((widths.getDirectBase()).size().longValue()); }
result.add(createFilter((COSName) COSName.fromValue(filter), null)); } else if (decodeParms.getType() == COSObjType.COS_ARRAY && decodeParms.size().intValue() > i) { decodeParms = decodeParms.at(i).get(); result.add(createFilter((COSName) COSName.fromValue(filter), decodeParms));
/** * @return a rectangle, expressed in the glyph coordinate system, that shall * specify the font bounding box. */ public double[] getFontBoundingBox() { if (fontBoundingBox == null) { COSBase bbox = this.getObject().getKey(ASAtom.FONT_BBOX).get(); if (bbox != null && bbox.getType() == COSObjType.COS_ARRAY && bbox.size() == 4) { double[] res = new double[4]; for (int i = 0; i < 4; ++i) { COSObject obj = bbox.at(i); if (obj.getType().isNumber()) { res[i] = obj.getReal(); } else { LOGGER.log(Level.SEVERE, "Font bounding box array for font " + fontName + " contains " + obj.getType()); return null; } } fontBoundingBox = res; } else { LOGGER.log(Level.SEVERE, "Font bounding box array for font " + fontName + " is not an array of 4 elements"); return null; } } return fontBoundingBox; }