Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSDocument


        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

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

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

        {
            if ( raf == null )
            {
                if( tempDirectory != null )
                {
                    document = new COSDocument( tempDirectory );
                }
                else
                {
                    document = new COSDocument();
                }
            }
            else
            {
                document = new COSDocument( raf );
            }
            setDocument( document );

            parseHeader();
View Full Code Here

            co.setGenerationNumber(COSInteger.ZERO);
            co.setObjectNumber(new COSInteger(10));

            assertFalse(COSUtils.isInteger(co, new IOCOSDocument()));

            COSDocument doc = new COSDocument();
            addToXref(doc, new COSObjectKey(co), 1000);
            COSUtils.isInteger(co, doc);
            doc.close();
        }
        catch (IOException e)
        {
            fail(e.getMessage());
        }
View Full Code Here

            co.setGenerationNumber(COSInteger.ZERO);
            co.setObjectNumber(new COSInteger(10));

            assertFalse(COSUtils.isFloat(co, new IOCOSDocument()));

            COSDocument doc = new COSDocument();
            addToXref(doc, new COSObjectKey(co), 1000);
            COSUtils.isFloat(co, doc);
            doc.close();
        }
        catch (IOException e)
        {
            fail(e.getMessage());
        }
View Full Code Here

            co.setGenerationNumber(COSInteger.ZERO);
            co.setObjectNumber(new COSInteger(10));

            assertFalse(COSUtils.isString(co, new IOCOSDocument()));

            COSDocument doc = new COSDocument();
            addToXref(doc, new COSObjectKey(co), 1000);
            COSUtils.isString(co, doc);
            doc.close();
        }
        catch (IOException e)
        {
            fail(e.getMessage());
        }
View Full Code Here

            co.setGenerationNumber(COSInteger.ZERO);
            co.setObjectNumber(new COSInteger(10));

            assertFalse(COSUtils.isStream(co, new IOCOSDocument()));

            COSDocument doc = new COSDocument();
            addToXref(doc, new COSObjectKey(co), 1000);
            COSUtils.isStream(co, doc);
            doc.close();
        }
        catch (IOException e)
        {
            fail(e.getMessage());
        }
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.