/** * Checks if flags of the annotation are authorized. * <UL> * <li>Print flag must be 1 * <li>NoView flag must be 0 * <li>Hidden flag must be 0 * <li>Invisible flag must be 0 * </UL> * If one of these flags is invalid, the errors list is updated with the ERROR_ANNOT_FORBIDDEN_FLAG ValidationError * code. * * @return false if a flag is invalid, true otherwise. */ protected boolean checkFlags() { boolean result = this.pdAnnot.isPrinted(); result = result && !this.pdAnnot.isHidden(); result = result && !this.pdAnnot.isInvisible(); result = result && !this.pdAnnot.isNoView(); if (!result) { ctx.addValidationError(new ValidationError(ERROR_ANNOT_FORBIDDEN_FLAG, "Flags of " + pdAnnot.getSubtype() + " annotation are invalid")); } return result; }
@Override public boolean isInvisible() { return annot != null && annot.isInvisible(); }
@Override Object[][] getFlagBits() { PDAnnotation annotation = new PDAnnotation(annotDictionary) { }; return new Object[][]{ new Object[]{1, "Invisible", annotation.isInvisible()}, new Object[]{2, "Hidden", annotation.isHidden()}, new Object[]{3, "Print", annotation.isPrinted()}, new Object[]{4, "NoZoom", annotation.isNoZoom()}, new Object[]{5, "NoRotate", annotation.isNoRotate()}, new Object[]{6, "NoView", annotation.isNoView()}, new Object[]{7, "ReadOnly", annotation.isReadOnly()}, new Object[]{8, "Locked", annotation.isLocked()}, new Object[]{9, "ToggleNoView", annotation.isToggleNoView()}, new Object[]{10, "LockedContents", annotation.isLocked()} }; } }
else if (!annotation.isInvisible() && !annotation.isHidden() && annotation.getNormalAppearanceStream() != null)
/** * Checks if flags of the annotation are authorized. * <UL> * <li>Print flag must be 1 * <li>NoView flag must be 0 * <li>Hidden flag must be 0 * <li>Invisible flag must be 0 * </UL> * If one of these flags is invalid, the errors list is updated with the ERROR_ANNOT_FORBIDDEN_FLAG ValidationError * code. * * @return false if a flag is invalid, true otherwise. */ protected boolean checkFlags() { boolean result = this.pdAnnot.isPrinted(); result = result && !this.pdAnnot.isHidden(); result = result && !this.pdAnnot.isInvisible(); result = result && !this.pdAnnot.isNoView(); if (!result) { ctx.addValidationError(new ValidationError(ERROR_ANNOT_FORBIDDEN_FLAG, "Flags of " + pdAnnot.getSubtype() + " annotation are invalid")); } return result; }
/** * Checks if flags of the annotation are authorized. * <UL> * <li>Print flag must be 1 * <li>NoView flag must be 0 * <li>Hidden flag must be 0 * <li>Invisible flag must be 0 * </UL> * If one of these flags is invalid, the errors list is updated with the ERROR_ANNOT_FORBIDDEN_FLAG ValidationError * code. * * @return false if a flag is invalid, true otherwise. */ protected boolean checkFlags() { boolean result = this.pdAnnot.isPrinted(); result = result && !this.pdAnnot.isHidden(); result = result && !this.pdAnnot.isInvisible(); result = result && !this.pdAnnot.isNoView(); if (!result) { ctx.addValidationError(new ValidationError(ERROR_ANNOT_FORBIDDEN_FLAG, "Flags of " + pdAnnot.getSubtype() + " annotation are invalid")); } return result; }
else if (!annotation.isInvisible() && !annotation.isHidden() && annotation.getNormalAppearanceStream() != null)
else if (!annotation.isInvisible() && !annotation.isHidden() && annotation.getNormalAppearanceStream() != null)