/** * Get the annotations appearance dictionary. * * <p> * This will get the annotations appearance dictionary. If this is not * existent an empty appearance dictionary will be created. * * @return the annotations appearance dictionary */ PDAppearanceDictionary getAppearance() { PDAppearanceDictionary appearanceDictionary = annotation.getAppearance(); if (appearanceDictionary == null) { appearanceDictionary = new PDAppearanceDictionary(); annotation.setAppearance(appearanceDictionary); } return appearanceDictionary; }
/** * Returns the appearance stream for this annotation, if any. The annotation state is taken into account, if * present. */ public PDAppearanceStream getNormalAppearanceStream() { PDAppearanceDictionary appearanceDict = getAppearance(); if (appearanceDict == null) { return null; } PDAppearanceEntry normalAppearance = appearanceDict.getNormalAppearance(); if (normalAppearance == null) { return null; } if (normalAppearance.isSubDictionary()) { COSName state = getAppearanceState(); return normalAppearance.getSubDictionary().get(state); } else { return normalAppearance.getAppearanceStream(); } }
PDRectangle rect = annot.getRectangle(); String appearanceName = annot.getAppearanceStream(); PDAppearanceDictionary appearDictionary = annot.getAppearance(); if( appearDictionary != null )
if (annotation.getAppearance() == null)
/** * Returns the appearance stream for this annotation, if any. The annotation state is taken into account, if * present. */ public PDAppearanceStream getNormalAppearanceStream() { PDAppearanceDictionary appearanceDict = getAppearance(); if (appearanceDict == null) { return null; } PDAppearanceEntry normalAppearance = appearanceDict.getNormalAppearance(); if (normalAppearance == null) { return null; } if (normalAppearance.isSubDictionary()) { COSName state = getAppearanceState(); return normalAppearance.getSubDictionary().get(state); } else { return normalAppearance.getAppearanceStream(); } }
private static String getN_type(PDAnnotation annot) { PDAppearanceDictionary appearanceDictionary = annot.getAppearance(); if (appearanceDictionary != null) { PDAppearanceEntry normalAppearance = appearanceDictionary.getNormalAppearance(); if (normalAppearance == null) { return null; } else if (normalAppearance.isSubDictionary()) { return DICT; } else { return STREAM; } } return null; }
/** * Returns the appearance stream for this annotation, if any. The annotation state is taken into account, if * present. */ public PDAppearanceStream getNormalAppearanceStream() { PDAppearanceDictionary appearanceDict = getAppearance(); if (appearanceDict == null) { return null; } PDAppearanceEntry normalAppearance = appearanceDict.getNormalAppearance(); if (normalAppearance == null) { return null; } if (normalAppearance.isSubDictionary()) { COSName state = getAppearanceState(); return normalAppearance.getSubDictionary().get(state); } else { return normalAppearance.getAppearanceStream(); } }
/** * Get the annotations appearance dictionary. * * <p> * This will get the annotations appearance dictionary. If this is not * existent an empty appearance dictionary will be created. * * @return the annotations appearance dictionary */ PDAppearanceDictionary getAppearance() { PDAppearanceDictionary appearanceDictionary = annotation.getAppearance(); if (appearanceDictionary == null) { appearanceDictionary = new PDAppearanceDictionary(); annotation.setAppearance(appearanceDictionary); } return appearanceDictionary; }
private void parseAppearance() { PDAppearanceDictionary appearanceDictionary = ((PDAnnotation) this.simplePDObject).getAppearance(); if (appearanceDictionary != null) { COSDictionary dictionary = appearanceDictionary.getCOSObject(); COSBase normalAppearanceBase = dictionary.getDictionaryObject(COSName.N); COSBase downAppearanceBase = dictionary.getDictionaryObject(COSName.D); COSBase rolloverAppearanceBase = dictionary.getDictionaryObject(COSName.R); if (normalAppearanceBase != null || downAppearanceBase != null || rolloverAppearanceBase != null) { List<PDContentStream> appearances = new ArrayList<>(); addContentStreamsFromAppearanceEntry(normalAppearanceBase, appearances); addContentStreamsFromAppearanceEntry(downAppearanceBase, appearances); addContentStreamsFromAppearanceEntry(rolloverAppearanceBase, appearances); this.appearance = Collections.unmodifiableList(appearances); } else { this.appearance = Collections.emptyList(); } } else { this.appearance = Collections.emptyList(); } }
private static List<PDAppearanceStream> getAllAppearances(PDAnnotation annotation) { List<PDAppearanceStream> res = new ArrayList<>(); if (annotation != null) { PDAppearanceDictionary appearance = annotation.getAppearance(); if (appearance != null) { addAllAppearances(appearance.getNormalAppearance(), res); addAllAppearances(appearance.getDownAppearance(), res); addAllAppearances(appearance.getRolloverAppearance(), res); } } return res; }
PDAppearanceDictionary ap = this.pdAnnot.getAppearance(); if (ap != null)
private Set<String> getAnnotationResourcesDependencies(PDAnnotation annot) { PDAppearanceDictionary dic = annot.getAppearance(); Set<String> appearances = new HashSet<>(); if (dic != null) { COSBase baseNormal = dic.getCOSObject().getItem(COSName.N); if (baseNormal != null) { appearances.addAll(getAppearanceEntryDependencies(dic.getNormalAppearance(), baseNormal)); } COSBase baseRollover = dic.getCOSObject().getItem(COSName.R); if (baseRollover != null) { appearances.addAll(getAppearanceEntryDependencies(dic.getRolloverAppearance(), baseRollover)); } COSBase baseDown = dic.getCOSObject().getItem(COSName.D); if (baseDown != null) { appearances.addAll(getAppearanceEntryDependencies(dic.getDownAppearance(), baseDown)); } } return appearances; }
if (annotation.getAppearance() == null)
if (annotation.getAppearance() == null)
PDAppearanceDictionary ap = this.pdAnnot.getAppearance(); if (ap != null)
PDAppearanceDictionary ap = this.pdAnnot.getAppearance(); if (ap != null)