Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSDictionary.keySet()


            retval = entry;
        }
        else if( parent instanceof COSDictionary )
        {
            COSDictionary dict = ((COSDictionary)parent);
            List<COSName> keys = new ArrayList<COSName>(dict.keySet());
            Collections.sort( keys );
            Object key = keys.get( index );
            Object value = dict.getDictionaryObject( (COSName)key );
            MapEntry entry = new MapEntry();
            entry.setKey( key );
View Full Code Here


            }
            else if( parent instanceof COSDictionary )
            {
                MapEntry entry = (MapEntry)child;
                COSDictionary dict = (COSDictionary)parent;
                List<COSName> keys = new ArrayList<COSName>(dict.keySet());
                Collections.sort( keys );
                for( int i=0; retval == -1 && i<keys.size(); i++ )
                {
                    if( keys.get( i ).equals( entry.getKey() ) )
                    {
View Full Code Here

            {
                /*
                 * Check that all referenced object are present in the PDF file
                 */
                COSDictionary dicFonts = COSUtils.getAsDictionary(cbFont, cosDocument);
                Set<COSName> keyList = dicFonts.keySet();
                for (Object key : keyList)
                {

                    COSBase item = dicFonts.getItem((COSName) key);
                    COSDictionary xObjFont = COSUtils.getAsDictionary(item, cosDocument);
View Full Code Here

        COSDictionary dict = (COSDictionary)resources.getDictionaryObject(kind);
        if (dict == null)
        {
            return Collections.emptySet();
        }
        return dict.keySet();
    }

    /**
     * Adds the given font to the resources of the current page and returns the name for the
     * new resources. Returns the existing resource name if the given item already exists.
View Full Code Here

        // find a unique key
        String key;
        do
        {
            key = prefix + (dict.keySet().size() + 1);
        }
        while (dict.containsKey(key));
        return COSName.getPDFName(key);
    }
View Full Code Here

        if (fontsDictionary == null)
        {
            fontsDictionary = new COSDictionary();
            resources.setItem(COSName.FONT, fontsDictionary);
        }
        for (COSName fontName : fontsDictionary.keySet())
        {
            COSBase font = fontsDictionary.getDictionaryObject(fontName);
            // data-000174.pdf contains a font that is a COSArray, looks to be an error in the
            // PDF, we will just ignore entries that are not dictionaries.
            if (font instanceof COSDictionary)
View Full Code Here

        COSDocument cosDocument = context.getDocument().getDocument();
        COSDictionary extGStates = COSUtils.getAsDictionary(egsEntry, cosDocument);

        if (extGStates != null)
        {
            for (Object object : extGStates.keySet())
            {
                COSName key = (COSName) object;
                if (key.getName().matches(TRANPARENCY_DICTIONARY_KEY_EXTGSTATE_ENTRY_REGEX))
                {
                    COSBase gsBase = extGStates.getItem(key);
View Full Code Here

        }

        COSDictionary dict = (COSDictionary)entry;
        Map<COSName, PDAppearanceStream> map = new HashMap<COSName, PDAppearanceStream>();

        for (COSName name : dict.keySet())
        {
            COSBase value = dict.getDictionaryObject(name);

            // the file from PDFBOX-1599 contains /null as its entry, so we skip non-stream entries
            if(value instanceof COSStream)
View Full Code Here

        if (aa != null)
        {
            COSDictionary aaDict = COSUtils.getAsDictionary(aa, cosDocument);
            if (aaDict != null)
            {
                for (Object key : aaDict.keySet())
                {
                    COSName name = (COSName) key;
                    callCreateAction(aaDict.getItem(name), ctx, result, name.getName(), alreadyCreated);
                }
            }
View Full Code Here

            Operator op = (Operator)o;
            if( op.getName().equals( "BI" ) )
            {
                output.write( "BI".getBytes("ISO-8859-1") );
                COSDictionary dic = op.getImageParameters();
                for( COSName key : dic.keySet() )
                {
                    Object value = dic.getDictionaryObject( key );
                    key.writePDF( output );
                    output.write( SPACE );
                    writeObject( value );
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.