private String getOnValueForWidget(PDAnnotationWidget widget) { PDAppearanceDictionary apDictionary = widget.getAppearance(); if (apDictionary != null) { PDAppearanceEntry normalAppearance = apDictionary.getNormalAppearance(); if (normalAppearance != null) { Set<COSName> entries = normalAppearance.getSubDictionary().keySet(); for (COSName entry : entries) { if (COSName.Off.compareTo(entry) != 0) { return entry.getName(); } } } } return ""; }
if (normalAppearance != null) Set<COSName> entries = normalAppearance.getSubDictionary().keySet(); for (COSName entry : entries)
/** * 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 void addAllAppearances(PDAppearanceEntry appearance, List<PDAppearanceStream> list) { if (appearance == null) { return; } if (appearance.isStream()) { PDAppearanceStream appearanceStream = appearance.getAppearanceStream(); if (appearanceStream != null) { list.add(appearanceStream); } } else { for (PDAppearanceStream appearanceStream : appearance.getSubDictionary().values()) { if (appearanceStream != null) { list.add(appearanceStream); } } } }
private Set<String> getAppearanceEntryDependencies(PDAppearanceEntry entry, COSBase entryLink) { Set<String> res = new HashSet<>(); if (entry.isStream()) { res.add(getAppearanceStreamDependencies(entry.getAppearanceStream(), entryLink)); } else { for (Map.Entry<COSName, PDAppearanceStream> mapEntry : entry.getSubDictionary().entrySet()) { res.add(getAppearanceStreamDependencies(mapEntry.getValue(), ((COSDictionary) entry.getCOSObject()).getItem(mapEntry.getKey()))); } } return res; }
private void addContentStreamsFromAppearanceEntry(COSBase appearanceEntry, List<PDContentStream> appearances) { if (appearanceEntry != null) { PDAppearanceEntry newAppearance = new PDAppearanceEntry(appearanceEntry); if (newAppearance.isStream()) { addAppearance(appearances, newAppearance.getAppearanceStream()); } else { Map<COSName, PDAppearanceStream> subDictionary = newAppearance.getSubDictionary(); for (PDAppearanceStream stream : subDictionary.values()) { addAppearance(appearances, stream); } } } }
private String getOnValueForWidget(PDAnnotationWidget widget) { PDAppearanceDictionary apDictionary = widget.getAppearance(); if (apDictionary != null) { PDAppearanceEntry normalAppearance = apDictionary.getNormalAppearance(); if (normalAppearance != null) { Set<COSName> entries = normalAppearance.getSubDictionary().keySet(); for (COSName entry : entries) { if (COSName.Off.compareTo(entry) != 0) { return entry.getName(); } } } } return ""; }
private String getOnValueForWidget(PDAnnotationWidget widget) { PDAppearanceDictionary apDictionary = widget.getAppearance(); if (apDictionary != null) { PDAppearanceEntry normalAppearance = apDictionary.getNormalAppearance(); if (normalAppearance != null) { Set<COSName> entries = normalAppearance.getSubDictionary().keySet(); for (COSName entry : entries) { if (COSName.Off.compareTo(entry) != 0) { return entry.getName(); } } } } return ""; }
if (normalAppearance != null) Set<COSName> entries = normalAppearance.getSubDictionary().keySet(); for (COSName entry : entries)
if (normalAppearance != null) Set<COSName> entries = normalAppearance.getSubDictionary().keySet(); for (COSName entry : entries)
/** * 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(); } }
/** * 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(); } }