Package org.apache.pdfbox.cos

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


        if(colorants == null)
        {
            colorants = new COSDictionary();
            dictionary.setItem(COSName.COLORANTS, colorants);
        }
        for(COSName name : colorants.keySet())
        {
            COSBase value = colorants.getDictionaryObject(name);
            actuals.put(name.getName(), (PDSeparation)PDColorSpace.create(value));
        }
        return new COSDictionaryMap<String, PDSeparation>(actuals, colorants);
View Full Code Here


            }
        }

        // the dictionaries preserve the order keys were added, as such we shall
        // add them in the proper order, not the reverse order
        Set<COSName> backwardsKeys = backwardsDictionary.keySet();
        for(int i = backwardsKeys.size()-1; i >=0; i--)
            dict.setItem((COSName)backwardsKeys.toArray()[i], backwardsDictionary.getItem((COSName)backwardsKeys.toArray()[i]));
       
        // consume the last two '<' chars
        readByteBackwards();
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

            {
                /*
                 * 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)ap).setItem(COSName.DEFAULT, aux );
        }
        COSDictionary map = (COSDictionary)ap;
        Map<String, PDAppearanceStream> actuals = new HashMap<String, PDAppearanceStream>();
        Map<String, PDAppearanceStream> retval = new COSDictionaryMap<String, PDAppearanceStream>( actuals, map );
        for( COSName asName : map.keySet() )
        {
            COSBase stream = map.getDictionaryObject( asName );
            // PDFBOX-1599: this is just a workaround. The given PDF provides "null" as stream
            // which leads to a COSName("null") value and finally to a ClassCastExcpetion
            if (stream instanceof COSStream)
View Full Code Here

                ((COSDictionary)ap).setItem(COSName.DEFAULT, aux );
            }
            COSDictionary map = (COSDictionary)ap;
            Map<String, PDAppearanceStream> actuals = new HashMap<String, PDAppearanceStream>();
            retval = new COSDictionaryMap<String, PDAppearanceStream>( actuals, map );
            for( COSName asName : map.keySet() )
            {
                COSBase stream = map.getDictionaryObject( asName );
                // PDFBOX-1599: this is just a workaround. The given PDF provides "null" as stream
                // which leads to a COSName("null") value and finally to a ClassCastExcpetion
                if (stream instanceof COSStream)
View Full Code Here

            }
            COSDictionary map = (COSDictionary)ap;
            Map<String, PDAppearanceStream> actuals =
                new HashMap<String, PDAppearanceStream>();
            retval = new COSDictionaryMap<String, PDAppearanceStream>( actuals, map );
            for( COSName asName : map.keySet() )
            {
                COSBase stream = map.getDictionaryObject( asName );
                // PDFBOX-1599: this is just a workaround. The given PDF provides "null" as stream
                // which leads to a COSName("null") value and finally to a ClassCastExcpetion
                if (stream instanceof COSStream)
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

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.