Package org.apache.pdfbox.preflight.exception

Examples of org.apache.pdfbox.preflight.exception.ValidationException


    {

        String type = action.getNameAsString(COSName.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
        String s = action.getNameAsString(COSName.S);
View Full Code Here


        this.catalog = pdfbox.getDocumentCatalog();

        if (this.catalog == null)
        {
            new ValidationError(ERROR_SYNTAX_NOCATALOG, "There are no Catalog entry in the Document.");
            throw new ValidationException("There are no Catalog entry in the Document.");
        }

        validateActions(ctx);
        validateLang(ctx);
        validateNames(ctx);
View Full Code Here

            addValidationError(ctx, new ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_ICC_PROFILE_INVALID,
                    "DestOutputProfile isn't a ICCProfile"));
        }
        catch (IOException e)
        {
            throw new ValidationException("Unable to parse the ICC Profile", e);
        }
    }
View Full Code Here

                }
            }
        }
        else
        {
            throw new ValidationException("There are no Catalog entry in the Document.");
        }
    }
View Full Code Here

    public static void validateElement(PreflightContext context, Object element, String processName)
            throws ValidationException
    {
        if (element == null)
        {
            throw new ValidationException("Unable to process an element if it is null.");
        }
        callValidation(context, element, processName);
    }
View Full Code Here

    private static void callValidation(PreflightContext context, Object element, String processName)
            throws ValidationException
    {
        if (context == null)
        {
            throw new ValidationException("Unable to process an element without context.");
        }

        PreflightPath validationPath = context.getValidationPath();
        boolean needPop = validationPath.pushObject(element);
        PreflightConfiguration config = context.getConfig();
View Full Code Here

            {
                validator = new XObjPostscriptValidator(context, stream);
            }
            else
            {
                throw new ValidationException("Invalid XObject subtype");
            }
        }
        else
        {
            throw new ValidationException("Graphic validation process needs at least one PDFont object");
        }

        validator.validate();
    }
View Full Code Here

    public void validate(PreflightContext ctx) throws ValidationException
    {
        PreflightPath vPath = ctx.getValidationPath();
        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);
View Full Code Here

                            ContextHelper.validateElement(context, stream, GRAPHIC_PROCESS);
                        }
                    }
                    catch (IOException e)
                    {
                        throw new ValidationException(e.getMessage(), e);
                    }
                }
            }
        }
    }
View Full Code Here

    public void validate(PreflightContext context) throws ValidationException
    {
        PreflightPath vPath = context.getValidationPath();
        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

TOP

Related Classes of org.apache.pdfbox.preflight.exception.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.