Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSDocument


     */
    private void checkCA(PreflightContext context, COSDictionary egs)
    {
        COSBase uCA = egs.getItem(TRANSPARENCY_DICTIONARY_KEY_UPPER_CA);
        COSBase lCA = egs.getItem(TRANSPARENCY_DICTIONARY_KEY_LOWER_CA);
        COSDocument cosDocument = context.getDocument().getDocument();

        if (uCA != null)
        {
            // ---- If CA is present only the value 1.0 is authorized
            Float fca = COSUtils.getAsFloat(uCA, cosDocument);
View Full Code Here


        createContext();
    }

    protected void createPdfADocument(Format format, PreflightConfiguration config) throws IOException
    {
        COSDocument cosDocument = getDocument();
        this.preflightDocument = new PreflightDocument(cosDocument, format, config);
    }
View Full Code Here

     * @param ctx
     * @throws ValidationException
     */
    public void validateOutputIntent(PreflightContext ctx) throws ValidationException
    {
        COSDocument cosDocument = ctx.getDocument().getDocument();
        COSBase cBase = catalog.getCOSObject().getItem(COSName.getPDFName(DOCUMENT_DICTIONARY_KEY_OUTPUT_INTENTS));
        COSArray outputIntents = COSUtils.getAsArray(cBase, cosDocument);

        Map<COSObjectKey, Boolean> tmpDestOutputProfile = new HashMap<COSObjectKey, Boolean>();
        for (int i = 0; outputIntents != null && i < outputIntents.size(); ++i)
View Full Code Here

                // else the profile will be kept in the tmpDestOutputProfile if it is valid
            }

            // keep reference to avoid multiple profile definition
            mapDestOutputProfile.put(new COSObjectKey((COSObject) destOutputProfile), true);
            COSDocument cosDocument = ctx.getDocument().getDocument();
            PDStream stream = PDStream.createFromCOS(COSUtils.getAsStream(destOutputProfile, cosDocument));
            if (stream == null)
            {
                addValidationError(ctx, new ValidationError(ERROR_GRAPHIC_OUTPUT_INTENT_INVALID_ENTRY,
                        "OutputIntent object uses a NULL Object"));
View Full Code Here

            context.addValidationError(new ValidationError(ERROR_ACTION_MISING_KEY,
                    "D entry is mandatory for the ThreadAction"));
            return false;
        }

        COSDocument cosDocument = this.context.getDocument().getDocument();
        if (!(COSUtils.isInteger(d, cosDocument) || COSUtils.isString(d, cosDocument) || COSUtils.isDictionary(d,
                cosDocument)))
        {
            context.addValidationError(new ValidationError(ERROR_ACTION_INVALID_TYPE, "D entry type is invalid"));
            return false;
View Full Code Here

     * @return true if the Count entry &gt; 0.
     */
    private boolean isCountEntryPositive(PreflightContext ctx, COSDictionary outline)
    {
        COSBase countBase = outline.getItem(COSName.getPDFName("Count"));
        COSDocument cosDocument = ctx.getDocument().getDocument();
        return COSUtils.isInteger(countBase, cosDocument) && (COSUtils.getAsInteger(countBase, cosDocument) > 0);
    }
View Full Code Here

        if (aDict != null)
        {
            callCreateAction(aDict, ctx, result, alreadyCreated);
        }

        COSDocument cosDocument = ctx.getDocument().getDocument();
        COSBase oaDict = dictionary.getDictionaryObject(DICTIONARY_KEY_OPEN_ACTION);
        if (oaDict != null)
        {
            if (!COSUtils.isArray(oaDict, cosDocument))
            {
View Full Code Here

     * @throws ValidationException
     */
    private void callCreateAction(COSBase aDict, PreflightContext ctx, List<AbstractActionManager> result,
            String additionActionKey, Map<COSObjectKey, Boolean> alreadyCreated) throws ValidationException
    {
        COSDocument cosDocument = ctx.getDocument().getDocument();
        if (COSUtils.isDictionary(aDict, cosDocument))
        {
            if (aDict instanceof COSObject)
            {
                COSObjectKey cok = new COSObjectKey((COSObject) aDict);
View Full Code Here

        Map<COSObjectKey, Boolean> alreadyCreated = new HashMap<COSObjectKey, Boolean>();

        COSBase nextDict = actionDictionary.getDictionaryObject(ACTION_DICTIONARY_KEY_NEXT);
        if (nextDict != null)
        {
            COSDocument cosDocument = ctx.getDocument().getDocument();
            if (COSUtils.isArray(nextDict, cosDocument))
            {
                COSArray array = COSUtils.getAsArray(nextDict, cosDocument);
                // ---- Next may contains an array of Action dictionary
                for (int i = 0; i < array.size(); ++i)
View Full Code Here

            context.addValidationError(new ValidationError(ERROR_ACTION_MISING_KEY,
                    "URI entry is mandatory for the UriAction"));
            return false;
        }

        COSDocument cosDocument = this.context.getDocument().getDocument();
        if (!COSUtils.isString(uri, cosDocument))
        {
            context.addValidationError(new ValidationError(ERROR_ACTION_INVALID_TYPE, "URI entry should be a string"));
            return false;
        }
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.cos.COSDocument

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.