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

                fontsDictionary = new COSDictionary();
                resources.setItem(COSName.FONT, fontsDictionary);
            }
            else
            {
                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

                resources.setItem(COSName.XOBJECT, xobjectsDictionary);
            }
            else
            {
                xobjects = new HashMap<String, PDXObject>();
                for (COSName objName : xobjectsDictionary.keySet())
                {
                    PDXObject xobject = null;
                    try
                    {
                        xobject = PDXObject.createXObject(xobjectsDictionary.getDictionaryObject(objName));
View Full Code Here

        {
            COSDictionary csDictionary = (COSDictionary) resources.getDictionaryObject(COSName.COLORSPACE);
            if (csDictionary != null)
            {
                colorspaces = new HashMap<String, PDColorSpace>();
                for (COSName csName : csDictionary.keySet())
                {
                    COSBase cs = csDictionary.getDictionaryObject(csName);
                    PDColorSpace colorspace = null;
                    try
                    {
View Full Code Here

        {
            COSDictionary states = (COSDictionary) resources.getDictionaryObject(COSName.EXT_G_STATE);
            if (states != null)
            {
                graphicsStates = new HashMap<String, PDExtendedGraphicsState>();
                for (COSName name : states.keySet())
                {
                    COSDictionary dictionary = (COSDictionary) states.getDictionaryObject(name);
                    graphicsStates.put(name.getName(), new PDExtendedGraphicsState(dictionary));
                }
            }
View Full Code Here

        {
            COSDictionary patternsDictionary = (COSDictionary) resources.getDictionaryObject(COSName.PATTERN);
            if (patternsDictionary != null)
            {
                patterns = new HashMap<String, PDPatternResources>();
                for (COSName name : patternsDictionary.keySet())
                {
                    COSDictionary dictionary = (COSDictionary) patternsDictionary.getDictionaryObject(name);
                    patterns.put(name.getName(), PDPatternResources.create(dictionary));
                }
            }
View Full Code Here

        {
            COSDictionary shadingsDictionary = (COSDictionary) resources.getDictionaryObject(COSName.SHADING);
            if (shadingsDictionary != null)
            {
                shadings = new HashMap<String, PDShadingResources>();
                for (COSName name : shadingsDictionary.keySet())
                {
                    COSDictionary dictionary = (COSDictionary) shadingsDictionary.getDictionaryObject(name);
                    shadings.put(name.getName(), PDShadingResources.create(dictionary));
                }
            }
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

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.