@Override public boolean resolveNextMapping() { PdfName mappedRole = roleMap.getAsName(currRole); if (mappedRole == null) { return false; } currRole = mappedRole; return true; } }
/** * PDF 2.0. The blend mode that shall be used when painting the annotation onto the page * * @return the blend mode */ public PdfName getBlendMode() { return getPdfObject().getAsName(PdfName.BM); }
/** * Gets a name specifying the tab order that shall be used for annotations on the page. * The possible values are {@link PdfName#R} (row order), {@link PdfName#C} (column order), and {@link PdfName#S} (structure order). * Beginning with PDF 2.0, the possible values also include {@link PdfName#A} (annotations array order) and {@link PdfName#W} (widget order). * See ISO 32000 12.5, "Annotations" for details. * * @return a {@link PdfName} specifying the annotations tab order or null if tab order is not defined. */ public PdfName getTabOrder() { return getPdfObject().getAsName(PdfName.Tabs); }
/** * The name of an icon that is used in displaying the annotation. Possible values are different for different * annotation types. See {@link #setIconName(PdfName)}. * @return a {@link PdfName} that specifies the icon for displaying annotation, or null if icon name is not specified. */ public PdfName getIconName() { return getPdfObject().getAsName(PdfName.Name); }
private PdfName getTypeFromParent(PdfDictionary field) { PdfDictionary parent = field.getAsDictionary(PdfName.Parent); PdfName formType = field.getAsName(PdfName.FT); if (parent != null) { formType = parent.getAsName(PdfName.FT); if (formType == null) { formType = getTypeFromParent(parent); } } return formType; }
@Override public PdfName getSubtype() { return getPdfObject().getAsName(PdfName.Subtype); }
/** * The name of an icon that is used in displaying the annotation. * Possible values are described in {@link #setIconName(PdfName)}. * * @return a {@link PdfName} that specifies the icon for displaying annotation, or null if icon name is not specified. */ public PdfName getIconName() { return getPdfObject().getAsName(PdfName.Name); }
/** * Getter for the annotation's highlighting mode. * @return Current value of the annotation's highlighting mode. */ public PdfName getHighlightMode() { return getPdfObject().getAsName(PdfName.H); }
/** * The type of PDF object that the wrapped dictionary describes; if present, shall be {@link PdfName#Sig} for a signature * dictionary or {@link PdfName#DocTimeStamp} for a timestamp signature dictionary. Shall be not null if it's value * is {@link PdfName#DocTimeStamp}. The default value is: {@link PdfName#Sig}. * @return a {@link PdfName} that identifies type of the wrapped dictionary, returns null if it is not explicitly specified. */ public PdfName getType() { return getPdfObject().getAsName(PdfName.Type); }
/** * The annotation’s appearance state, which selects the applicable appearance stream * from an appearance subdictionary if there is such. See {@link PdfAnnotation#getAppearanceObject(PdfName)} * for more info. * * @return a {@link PdfName} which defines selected appearance state. */ public PdfName getAppearanceState() { return getPdfObject().getAsName(PdfName.AS); }
/** * The name of an icon that is used in displaying the annotation. Possible values are different for different * annotation types. See {@link #setIconName(PdfName)}. * @return a {@link PdfName} that specifies the icon for displaying annotation, or null if icon name is not specified. */ public PdfName getIconName() { return getPdfObject().getAsName(PdfName.Name); }
@Override public PdfName getSubtype() { PdfName subType = getPdfObject().getAsName(PdfName.Subtype); if (subType == null) { subType = PdfName.Underline; } return subType; }
/** * Gets rendering intent value, {@code RI} key. * Valid values are: {@code AbsoluteColorimetric}, {@code RelativeColorimetric}, * {@code Saturation}, {@code Perceptual}. * * @return a {@code PdfName} instance. */ public PdfName getRenderingIntent() { return getPdfObject().getAsName(PdfName.RI); }
/** * A name describing the intent of the markup annotation. * See {@link #setIntent(PdfName)} for more info. * @return a {@link PdfName} describing the intent of the markup annotation, or null if not specified. */ public PdfName getIntent() { return getPdfObject().getAsName(PdfName.IT); }
/** * Method to to distinguish struct elements from other elements of the logical tree (like mcr or struct tree root). */ public static boolean isStructElem(PdfDictionary dictionary) { return (PdfName.StructElem.equals(dictionary.getAsName(PdfName.Type)) || dictionary.containsKey(PdfName.S)); // required key of the struct elem }
public String getAttributeAsEnum(String attributeName) { PdfName name = PdfStructTreeRoot.convertRoleToPdfName(attributeName); PdfName attrVal = getPdfObject().getAsName(name); return attrVal != null ? attrVal.getValue() : null; }
private PdfDictionary getPdfAOutputIntent(PdfArray outputIntents) { for (int i = 0; i < outputIntents.size(); ++i) { PdfName outputIntentSubtype = outputIntents.getAsDictionary(i).getAsName(PdfName.S); if (PdfName.GTS_PDFA1.equals(outputIntentSubtype)) { return outputIntents.getAsDictionary(i); } } return null; }
private static boolean imageColorSpaceIsKnown(PdfDictionary imageDictionary, PdfDictionary colorSpaceDic) { PdfName cs = imageDictionary.getAsName(PdfName.ColorSpace); if (cs == null || cs.equals(PdfName.DeviceGray) || cs.equals(PdfName.DeviceRGB) || cs.equals(PdfName.DeviceCMYK)) return true; return colorSpaceDic != null && colorSpaceDic.containsKey(cs); }
/** * Gets the visibility policy for content belonging to this * optional content membership dictionary. */ public PdfName getVisibilityPolicy() { PdfName visibilityPolicy = getPdfObject().getAsName(PdfName.P); if (visibilityPolicy == null || !visibilityPolicy.equals(PdfName.AllOn) && !visibilityPolicy.equals(PdfName.AllOff) && !visibilityPolicy.equals(PdfName.AnyOn) && !visibilityPolicy.equals(PdfName.AnyOff)) return PdfName.AnyOn; return visibilityPolicy; }
private boolean isRadioButton() { if (isWidgetAnnotation(getPdfObject())) { return true; } else if (getPdfObject().getAsName(PdfName.V) != null) { return false; } else if (getKids() != null) { return isWidgetAnnotation(getKids().getAsDictionary(0)); } else { return false; } }