Package org.apache.padaf.preflight

Examples of org.apache.padaf.preflight.ValidationException


      } else {
        result.add(createActionManager(COSUtils.getAsDictionary(aDict, cDoc),
            cDoc, additionActionKey));
      }
    } else {
      throw new ValidationException(
          "Action entry isn't an instance of COSDictionary");
    }
  }
View Full Code Here


  protected AbstractActionManager createActionManager(COSDictionary action,
      COSDocument cDoc, String aaKey) throws ValidationException {

    String type = action.getNameAsString(DICTIONARY_KEY_TYPE);
    if (type != null && !ACTION_DICTIONARY_VALUE_TYPE.equals(type)) {
      throw new ValidationException(
          "The given dictionary isn't the dictionary of an Action");
    }

    // ---- S is a mandatory fields. If S entry is missing, the return will
    // return the InvalidAction manager
View Full Code Here

  protected boolean processCIDFontType0(COSBase fontDesc)
      throws ValidationException {
    COSDictionary fontDescDic = COSUtils.getAsDictionary(fontDesc, handler
        .getDocument().getDocument());
    if (fontDescDic == null) {
      throw new ValidationException(
          "Unable to process CIDFontType0 because of the font descriptor is invalid.");
    }
    PDFontDescriptorDictionary pfDescriptor = new PDFontDescriptorDictionary(
        fontDescDic);
    boolean isValid = checkFontDescriptorMandatoryFields(pfDescriptor);
View Full Code Here

  protected boolean processCIDFontType2(COSBase fontDesc)
      throws ValidationException {
    COSDictionary fontDescDic = COSUtils.getAsDictionary(fontDesc, handler
        .getDocument().getDocument());
    if (fontDescDic == null) {
      throw new ValidationException(
          "Unable to process CIDFontType2 because of the font descriptor is invalid.");
    }
    PDFontDescriptorDictionary pfDescriptor = new PDFontDescriptorDictionary(
        fontDescDic);
    boolean isValid = checkFontDescriptorMandatoryFields(pfDescriptor);
View Full Code Here

        if (key.getName().matches(
            TRANPARENCY_DICTIONARY_KEY_EXTGSTATE_ENTRY_REGEX)) {
          COSBase gsBase = extGStates.getItem(key);
          COSDictionary gsDict = COSUtils.getAsDictionary(gsBase, cDoc);
          if (gsDict == null) {
            throw new ValidationException(
                "The Extended Graphics State dictionary is invalid");
          }
          this.listOfExtGState.add(gsDict);
        }
      }
View Full Code Here

    COSDictionary groupDictionary = COSUtils.getAsDictionary(baseGroup,
        cosDocument);
    if (groupDictionary != null) {
      if (!XOBJECT_DICTIONARY_KEY_GROUP.equals(groupDictionary
          .getNameAsString(DICTIONARY_KEY_TYPE))) {
        throw new ValidationException(
            "The Group dictionary hasn't Group as Type value");
      }

      String sVal = groupDictionary
          .getNameAsString(XOBJECT_DICTIONARY_KEY_GROUP_S);
View Full Code Here

          pdcs = PDColorSpaceFactory.createColorSpace(((COSObject)csObject).getObject());
        } else {
          pdcs = PDColorSpaceFactory.createColorSpace(csObject);
        }
      } catch (IOException e) {
        throw new ValidationException("Unable to create a PDColorSpace : "
            + e.getMessage(), e);
      }
    }

    if ( pdcs == null ) {
      throw new ValidationException(
          "Unable to create a PDColorSpace with the value null");
    }

    return processAllColorSpace(pdcs, result);
  }
View Full Code Here

  public List<ValidationError> validateMetadataSynchronization(PDDocument document, XMPMetadata metadata)
  throws ValidationException {
    List<ValidationError> ve = new ArrayList<ValidationError>();

    if (document == null) {
      throw new ValidationException("Document provided is null");
    } else {
      PDDocumentInformation dico = document.getDocumentInformation();
      if (metadata == null) {
        throw new ValidationException("Metadata provided are null");
      } else {
        DublinCoreSchema dc = metadata.getDublinCoreSchema();

        // TITLE
        analyzeTitleProperty(dico, dc, ve);
View Full Code Here

      ((Type1FontContainer)this.fontContainer).setFontObject(parsedData);

      return true;
    } catch (IOException e) {
      throw new ValidationException("Unable to check Type1 metrics due to : "
          + e.getMessage(), e);
    }
  }
View Full Code Here

  protected ValidationException formatAccessException(String type,
      String target, Throwable cause) {
    StringBuilder sb = new StringBuilder(80);
    sb.append("Cannot treat ").append(type).append(" ").append(target).append(
        " property");
    return new ValidationException(sb.toString(), cause);
  }
View Full Code Here

TOP

Related Classes of org.apache.padaf.preflight.ValidationException

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.