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

                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

        //TODO: Let's try to move this into PDFBox.
        //Attempt to determine Adobe extension level, if present:
        COSDictionary root = document.getDocumentCatalog().getCOSDictionary();
        COSDictionary extensions = (COSDictionary) root.getDictionaryObject(COSName.getPDFName("Extensions") );
        if( extensions != null ) {
            for( COSName extName : extensions.keySet() ) {
                // If it's an Adobe one, interpret it to determine the extension level:
                if( extName.equals( COSName.getPDFName("ADBE") )) {
                    COSDictionary adobeExt = (COSDictionary) extensions.getDictionaryObject(extName);
                    if( adobeExt != null ) {
                        String baseVersion = adobeExt.getNameAsString(COSName.getPDFName("BaseVersion"));
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

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.