Package org.apache.pdfbox.preflight

Examples of org.apache.pdfbox.preflight.PreflightPath.peek()


        {
            context.addValidationError(new ValidationError(PreflightConstants.ERROR_GRAPHIC_XOBJECT_INVALID_TYPE, "ExtGState validation required at least a Resource dictionary"));
        }
        else
        {
            COSDictionary extGStatesDict = (COSDictionary) vPath.peek();
            List<COSDictionary> listOfExtGState = extractExtGStateDictionaries(context, extGStatesDict);
            validateTransparencyRules(context, listOfExtGState);
        }
    }
View Full Code Here


        PreflightPath vPath = context.getValidationPath();

        XObjectValidator validator = null;
        if (!vPath.isEmpty() && vPath.isExpectedType(PDXObjectImage.class))
        {
            validator = new XObjImageValidator(context, (PDXObjectImage) vPath.peek());
        }
        else if (!vPath.isEmpty() && vPath.isExpectedType(PDXObjectForm.class))
        {
            validator = new XObjFormValidator(context, (PDXObjectForm) vPath.peek());
        }
View Full Code Here

        {
            validator = new XObjImageValidator(context, (PDXObjectImage) vPath.peek());
        }
        else if (!vPath.isEmpty() && vPath.isExpectedType(PDXObjectForm.class))
        {
            validator = new XObjFormValidator(context, (PDXObjectForm) vPath.peek());
        }
        else if (!vPath.isEmpty() && vPath.isExpectedType(COSStream.class))
        {
            COSStream stream = (COSStream) vPath.peek();
            String subType = stream.getNameAsString(COSName.SUBTYPE);
View Full Code Here

        {
            validator = new XObjFormValidator(context, (PDXObjectForm) vPath.peek());
        }
        else if (!vPath.isEmpty() && vPath.isExpectedType(COSStream.class))
        {
            COSStream stream = (COSStream) vPath.peek();
            String subType = stream.getNameAsString(COSName.SUBTYPE);
            if (XOBJECT_DICTIONARY_VALUE_SUBTYPE_POSTSCRIPT.equals(subType))
            {
                validator = new XObjPostscriptValidator(context, stream);
            }
View Full Code Here

        if (vPath.isEmpty() && !vPath.isExpectedType(PDResources.class))
        {
            throw new ValidationException("Resources validation process needs at least one PDResources object");
        }

        PDResources resources = (PDResources) vPath.peek();

        validateFonts(ctx, resources);
        validateExtGStates(ctx, resources);
        validateShadingPattern(ctx, resources);
        validateTilingPattern(ctx, resources);
View Full Code Here

        if (vPath.isEmpty() || !vPath.isExpectedType(COSDictionary.class))
        {
            throw new ValidationException("ExtGState validation required at least a Resource dictionary");
        }

        COSDictionary extGStatesDict = (COSDictionary) vPath.peek();
        List<COSDictionary> listOfExtGState = extractExtGStateDictionaries(context, extGStatesDict);
        validateTransparencyRules(context, listOfExtGState);
    }

    /**
 
View Full Code Here

        if (vPath.isEmpty() || !vPath.isExpectedType(COSDictionary.class))
        {
            throw new ValidationException("Annotation validation process needs at least one COSDictionary object");
        }

        COSDictionary annotDict = (COSDictionary) vPath.peek();

        PreflightConfiguration config = context.getConfig();
        AnnotationValidatorFactory factory = config.getAnnotFact();
        AnnotationValidator annotValidator = factory.getAnnotationValidator(context, annotDict);
        if (annotValidator != null)
View Full Code Here

        if (vPath.isEmpty() && !vPath.isExpectedType(PDResources.class))
        {
            throw new ValidationException("ShadingPattern validation required at least a PDResources");
        }

        PDShadingResources shaddingResource = (PDShadingResources) vPath.peek();
        PDPage page = vPath.getClosestPathElement(PDPage.class);
        checkColorSpace(context, page, shaddingResource);
        checkGraphicState(context, page, shaddingResource);
    }
View Full Code Here

        if (vPath.isEmpty() || !vPath.isExpectedType(COSDictionary.class))
        {
            throw new ValidationException("Action validation process needs at least one COSDictionary object");
        }

        COSDictionary actionsDict = (COSDictionary) vPath.peek();
        // AA entry is authorized only for Page, in this case A Page is just before the Action Dictionary in the path
        boolean aaEntryAuth = ((vPath.size() - vPath.getClosestTypePosition(PDPage.class)) == 2);

        PreflightConfiguration config = context.getConfig();
        ActionManagerFactory factory = config.getActionFact();
View Full Code Here

        if (vPath.isEmpty() && !vPath.isExpectedType(PDPage.class))
        {
            throw new ValidationException("Page validation required at least a PDPage");
        }

        PDPage page = (PDPage) vPath.peek();
        validateActions(context, page);
        validateAnnotation(context, page);
        validateColorSpaces(context, page);
        validateResources(context, page);
        validateGraphicObjects(context, page);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.