Package org.apache.padaf.preflight.ValidationResult

Examples of org.apache.padaf.preflight.ValidationResult.ValidationError


      if (!(encodingName.equals(FONT_DICTIONARY_VALUE_ENCODING_MAC)
          || encodingName.equals(FONT_DICTIONARY_VALUE_ENCODING_MAC_EXP)
          || encodingName.equals(FONT_DICTIONARY_VALUE_ENCODING_WIN)
          || encodingName.equals(FONT_DICTIONARY_VALUE_ENCODING_PDFDOC) || encodingName
          .equals(FONT_DICTIONARY_VALUE_ENCODING_STD))) {
        this.fontContainer.addError(new ValidationError(ERROR_FONTS_ENCODING));
        return false;
      }
    } else if (COSUtils.isDictionary(this.encoding, cDoc)) {
      this.pFont.getFontEncoding();
    } else if (this.encoding != null) {
      this.fontContainer.addError(new ValidationError(ERROR_FONTS_ENCODING));
      return false;
    }
    //else
    // ---- According to PDF Reference, the encoding entry is optional.
    // PDF/A specification only speaks of TrueType encoding
View Full Code Here


   * net.awl.edoc.pdfa.validation.actions.AbstractActionManager#valid(java.util
   * .List)
   */
  @Override
  protected boolean innerValid(List<ValidationError> error) {
    error.add(new ValidationError(ERROR_ACTION_FORBIDDEN_ACTIONS_UNDEF, "The action "
        + actionName + " is undefined"));
    return false;
  }
View Full Code Here

    StringBuilder sb = new StringBuilder(80);
    sb
        .append(target)
        .append(
            " present in the document catalog dictionary doesn't match with XMP information");
    return new ValidationError(ValidationConstants.ERROR_METADATA_MISMATCH, sb
        .toString());
  }
View Full Code Here

    sb
        .append(target)
        .append(
            " present in the document catalog dictionary can't be found in XMP information (")
        .append(schema).append(" schema not declared)");
    return new ValidationError(ValidationConstants.ERROR_METADATA_MISMATCH, sb
        .toString());
  }
View Full Code Here

    sb
        .append(target)
        .append(
            " present in the document catalog dictionary can't be found in XMP information (")
        .append(details).append(")");
    return new ValidationError(ValidationConstants.ERROR_METADATA_MISMATCH, sb
        .toString());
  }
View Full Code Here

  protected boolean checkMandatoryFields(List<ValidationError> result) {
    boolean res = this.xobject.getItem(COSName.getPDFName("Width")) != null;
    res = res && this.xobject.getItem(COSName.getPDFName("Height")) != null;
    // type and subtype checked before to create the Validator.
    if (!res) {
      result.add(new ValidationError(ERROR_GRAPHIC_MISSING_FIELD));
    }
    return res;
  }
View Full Code Here

  /*
   * 6.2.4 no Alternates
   */
  protected void checkAlternates(List<ValidationError> result) throws ValidationException {
    if (this.xobject.getItem(COSName.getPDFName("Alternates")) != null) {
      result.add(new ValidationError(
          ValidationConstants.ERROR_GRAPHIC_UNEXPECTED_KEY,
      "Unexpected 'Alternates' Key"));
    }
  }
View Full Code Here

    COSBase d = this.actionDictionnary.getItem(COSName
        .getPDFName(ACTION_DICTIONARY_KEY_D));

    // ---- D entry is mandatory
    if (d == null) {
      error.add(new ValidationError(ERROR_ACTION_MISING_KEY,
          "D entry is mandatory for the GoToActions"));
      return false;
    }

    if (!(d instanceof COSName || COSUtils.isString(d, cDoc) || COSUtils
        .isArray(d, cDoc))) {
      error.add(new ValidationError(ERROR_ACTION_INVALID_TYPE, "Type of D entry is invalid"));
      return false;
    }

    return true;
  }
View Full Code Here

   * 6.2.4 if interpolates, value = false
   */
  protected void checkInterpolate(List<ValidationError> result) throws ValidationException {
    if (this.xobject.getItem(COSName.getPDFName("Interpolate")) != null) {
      if (this.xobject.getBoolean(COSName.getPDFName("Interpolate"), true)) {
        result.add(new ValidationError(
            ValidationConstants.ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY,
        "Unexpected 'true' value for 'Interpolate' Key"));
      }
    }
  }
View Full Code Here

   */
  protected void checkIntent(List<ValidationError> result) throws ValidationException {
    if (this.xobject.getItem(COSName.getPDFName("Intent")) != null) {
      String s = this.xobject.getNameAsString("Intent");
      if (!RenderingIntents.contains(s)) {
        result.add(new ValidationError(ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY,
            "Unexpected value '" + s + "' for Intent key in image"));
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.padaf.preflight.ValidationResult.ValidationError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.