@Override public String getN_type() { PDAppearanceEntry normalAppearance = ((PDAnnotation) simplePDObject).getNormalAppearance(); if (normalAppearance == null) { return null; } else if (normalAppearance.isSubDictionary()) { return DICT; } else { return STREAM; } }
private List<PDContentStream> parseAppearance() { PDAppearanceEntry normalAppearance = ((PDAnnotation) simplePDObject).getNormalAppearance(); PDAppearanceEntry downAppearance = ((PDAnnotation) simplePDObject).getDownAppearance(); PDAppearanceEntry rolloverAppearance = ((PDAnnotation) simplePDObject).getRolloverAppearance(); if (normalAppearance != null || downAppearance != null || rolloverAppearance != null) { List<PDContentStream> appearances = new ArrayList<>(); addContentStreamsFromAppearanceEntry(normalAppearance, appearances); addContentStreamsFromAppearanceEntry(downAppearance, appearances); addContentStreamsFromAppearanceEntry(rolloverAppearance, appearances); return Collections.unmodifiableList(appearances); } return Collections.emptyList(); }
private Set<String> getAnnotationResourcesDependencies(PDAnnotation annot) { Set<String> appearances = new HashSet<>(); PDAppearanceEntry normalAppearance = annot.getNormalAppearance(); if (normalAppearance != null) { appearances.addAll(getAppearanceEntryDependencies(normalAppearance)); } PDAppearanceEntry rolloverAppearance = annot.getRolloverAppearance(); if (rolloverAppearance != null) { appearances.addAll(getAppearanceEntryDependencies(rolloverAppearance)); } PDAppearanceEntry downAppearance = annot.getDownAppearance(); if (downAppearance != null) { appearances.addAll(getAppearanceEntryDependencies(downAppearance)); } return appearances; }
private static List<PDAppearanceStream> getAllAppearances(PDAnnotation annotation) { List<PDAppearanceStream> res = new ArrayList<>(); if (annotation != null) { addAllAppearances(annotation.getNormalAppearance(), res); addAllAppearances(annotation.getDownAppearance(), res); addAllAppearances(annotation.getRolloverAppearance(), res); } return res; }