@Override protected boolean checkSpecificMandatoryFields() { return this.annotDictionary.containsKey(COSName.DA); } }
/** * Returns true if widths are present in the font descriptor. */ public boolean hasWidths() { return dic.containsKey(COSName.WIDTHS) || dic.containsKey(COSName.MISSING_WIDTH); }
/** * Returns true if the missing widths entry is present in the font descriptor. */ public boolean hasMissingWidth() { return dic.containsKey(COSName.MISSING_WIDTH); }
@Override protected boolean checkSpecificMandatoryFields() { return this.annotDictionary.containsKey(COSName.L); } }
/** * Tell if the dictionary is a FDF catalog. * * @param dictionary * @return true if the dictionary is a FDF catalog */ @Override protected final boolean isCatalog(COSDictionary dictionary) { return dictionary.containsKey(COSName.FDF); }
/** * This will tell if the AcroForm has XFA content. * * @return true if the AcroForm is an XFA form */ public boolean hasXFA() { return dictionary.containsKey(COSName.XFA); }
protected void checkMandatoryField() { boolean areFieldsPResent = fontDictionary.containsKey(COSName.FONT_BBOX); areFieldsPResent &= fontDictionary.containsKey(COSName.FONT_MATRIX); areFieldsPResent &= fontDictionary.containsKey(COSName.CHAR_PROCS); areFieldsPResent &= fontDictionary.containsKey(COSName.ENCODING); areFieldsPResent &= fontDictionary.containsKey(COSName.FIRST_CHAR); areFieldsPResent &= fontDictionary.containsKey(COSName.LAST_CHAR); areFieldsPResent &= fontDictionary.containsKey(COSName.WIDTHS); if (!areFieldsPResent) { this.fontContainer.push(new ValidationError(ERROR_FONTS_DICTIONARY_INVALID, font.getName() + ": Some required fields are missing from the Font dictionary.")); } }
@Override protected boolean checkSpecificMandatoryFields() { return this.annotDictionary.containsKey(COSName.getPDFName(ANNOT_DICTIONARY_KEY_QUADPOINTS)); } }
@Override protected boolean checkSpecificMandatoryFields() { return this.annotDictionary.containsKey(COSName.getPDFName(ANNOT_DICTIONARY_KEY_INKLIST)); } }
/** * @see java.util.Map#containsKey(Object) * * @param name The key to find in the map. * @return true if the map contains this key. */ public boolean containsKey(String name) { return containsKey(COSName.getPDFName(name)); }
/** * Returns true if the node is a page tree node (i.e. and intermediate). */ private boolean isPageTreeNode(COSDictionary node ) { // some files such as PDFBOX-2250-229205.pdf don't have Pages set as the Type, so we have // to check for the presence of Kids too return node != null && (node.getCOSName(COSName.TYPE) == COSName.PAGES || node.containsKey(COSName.KIDS)); }
@Override protected void checkMandatoryField() { boolean arePresent = fontDictionary.containsKey(COSName.TYPE); arePresent &= fontDictionary.containsKey(COSName.SUBTYPE); arePresent &= fontDictionary.containsKey(COSName.BASE_FONT); arePresent &= fontDictionary.containsKey(COSName.CIDSYSTEMINFO); arePresent &= fontDictionary.containsKey(COSName.FONT_DESC); if (!arePresent) { this.fontContainer.push(new ValidationError(ERROR_FONTS_DICTIONARY_INVALID, font.getName() + ": Required keys are missing")); } checkCIDSystemInfo(fontDictionary.getItem(COSName.CIDSYSTEMINFO)); checkCIDToGIDMap(fontDictionary.getItem(COSName.CID_TO_GID_MAP)); }
@Override public boolean hasExplicitWidth(int code) throws IOException { if (dict.containsKey(COSName.WIDTHS)) { int firstChar = dict.getInt(COSName.FIRST_CHAR, -1); if (code >= firstChar && code - firstChar < getWidths().size()) { return true; } } return false; } }
private boolean isImageStream(COSDictionary dic, boolean isThumb) { if (isThumb) { return true; } return dic.containsKey(COSName.SUBTYPE) && dic.getCOSName(COSName.SUBTYPE).equals(COSName.IMAGE); }
private boolean isAnnot(Object obj) { Object underneathObject = getUnderneathObject(obj); return underneathObject instanceof COSDictionary && ((COSDictionary) underneathObject).containsKey(COSName.TYPE) && ((COSDictionary) underneathObject).getCOSName(COSName.TYPE).equals(COSName.ANNOT); }
private boolean isXmlMetadataStream(COSDictionary dic) { return dic.containsKey(COSName.SUBTYPE) && dic.getCOSName(COSName.SUBTYPE).equals(COSName.getPDFName("XML")); } }
private boolean isFontDescriptor(Object obj) { Object underneathObject = getUnderneathObject(obj); return underneathObject instanceof COSDictionary && ((COSDictionary) underneathObject).containsKey(COSName.TYPE) && ((COSDictionary) underneathObject).getCOSName(COSName.TYPE).equals(COSName.FONT_DESC); }
private boolean isFont(Object selectedNode) { selectedNode = getUnderneathObject(selectedNode); if (selectedNode instanceof COSDictionary) { COSDictionary dic = (COSDictionary)selectedNode; return dic.containsKey(COSName.TYPE) && dic.getCOSName(COSName.TYPE).equals(COSName.FONT) && !isCIDFont(dic); } return false; }
private boolean isCIDFont(COSDictionary dic) { return dic.containsKey(COSName.SUBTYPE) && (dic.getCOSName(COSName.SUBTYPE).equals(COSName.CID_FONT_TYPE0) || dic.getCOSName(COSName.SUBTYPE).equals(COSName.CID_FONT_TYPE2)); }
/** * Returns the group color space or null if it isn't defined. * * @return the group color space. * @throws IOException */ public PDColorSpace getColorSpace() throws IOException { if (colorSpace == null && getCOSObject().containsKey(COSName.CS)) { colorSpace = PDColorSpace.create(getCOSObject().getDictionaryObject(COSName.CS)); } return colorSpace; }