Package org.apache.pdfbox.cos

Examples of org.apache.pdfbox.cos.COSString


                }

            }
            else if ( baseFont instanceof COSString )
            {
                COSString string = (COSString)baseFont;
                name = string.getString();
            }
            if ( name != null )
            {
                afm = afmObjects.get( name );
            }
View Full Code Here


                }
                newKArray.addAll(srcKArray);
            }
            kDictLevel0.setItem(COSName.K, newKArray);
            kDictLevel0.setItem(COSName.P, destStructTree);
            kDictLevel0.setItem(COSName.S, new COSString(STRUCTURETYPE_DOCUMENT));
            destStructTree.setK(kDictLevel0);
        }
    }
View Full Code Here

        if( namesArray != null )
        {
            Map<String, COSObjectable> names = new LinkedHashMap<String, COSObjectable>();
            for( int i=0; i<namesArray.size(); i+=2 )
            {
                COSString key = (COSString)namesArray.getObject(i);
                COSBase cosValue = namesArray.getObject( i+1 );
                names.put( key.getString(), convertCOSToPD(cosValue) );
            }
            return Collections.unmodifiableMap(names);
        }
        else
        {
View Full Code Here

            COSArray array = new COSArray();
            List<String> keys = new ArrayList<String>(names.keySet());
            Collections.sort(keys);
            for (String key : keys)
            {
                array.add(new COSString(key));
                array.add(names.get(key));
            }
            node.setItem(COSName.NAMES, array);
            calculateLimits();
        }
View Full Code Here

 
            int recipientFieldsLength = 0;
 
            for(int i=0; i<encDictionary.getRecipientsLength(); i++)
            {
                COSString recipientFieldString = encDictionary.getRecipientStringAt(i);
                byte[] recipientBytes = recipientFieldString.getBytes();
                CMSEnvelopedData data = new CMSEnvelopedData(recipientBytes);
                Iterator recipCertificatesIt = data.getRecipientInfos().getRecipients().iterator();
                while(recipCertificatesIt.hasNext())
                {
                    RecipientInformation ri =
View Full Code Here

            int sha1InputLength = seed.length;

            for(int j=0; j<dictionary.getRecipientsLength(); j++)
            {
                COSString string = dictionary.getRecipientStringAt(j);
                sha1InputLength += string.getBytes().length;
            }


            byte[] sha1Input = new byte[sha1InputLength];

            System.arraycopy(seed, 0, sha1Input, 0, 20);

            int sha1InputOffset = 20;


            for(int j=0; j<dictionary.getRecipientsLength(); j++)
            {
                COSString string = dictionary.getRecipientStringAt(j);
                System.arraycopy(
                    string.getBytes(), 0,
                    sha1Input, sha1InputOffset, string.getBytes().length);
                sha1InputOffset += string.getBytes().length;
            }

            MessageDigest md = MessageDigest.getInstance("SHA-1");

            byte[] mdResult = md.digest(sha1Input);
View Full Code Here

    {
        PDColorSpace baseColor = getBaseColorSpace();
        int numberOfComponents = baseColor.getNumberOfComponents();
        byte[] data = getLookupData();
        data[lookupIndex * numberOfComponents + componentNumber] = (byte) color;
        COSString string = new COSString(data);
        array.set(3, string);
    }
View Full Code Here

                }
                newKArray.addAll(srcKArray);
            }
            kDictLevel0.setItem(COSName.K, newKArray);
            kDictLevel0.setItem(COSName.P, destStructTree);
            kDictLevel0.setItem(COSName.S, new COSString(STRUCTURETYPE_DOCUMENT));
            destStructTree.setK(kDictLevel0);
        }
    }
View Full Code Here

 
            int recipientFieldsLength = 0;
 
            for(int i=0; i<encDictionary.getRecipientsLength(); i++)
            {
                COSString recipientFieldString = encDictionary.getRecipientStringAt(i);
                byte[] recipientBytes = recipientFieldString.getBytes();
                CMSEnvelopedData data = new CMSEnvelopedData(recipientBytes);
                Iterator recipCertificatesIt = data.getRecipientInfos().getRecipients().iterator();
                while(recipCertificatesIt.hasNext())
                {
                    RecipientInformation ri =
View Full Code Here

            int sha1InputLength = seed.length;

            for(int j=0; j<dictionary.getRecipientsLength(); j++)
            {
                COSString string = dictionary.getRecipientStringAt(j);
                sha1InputLength += string.getBytes().length;
            }


            byte[] sha1Input = new byte[sha1InputLength];

            System.arraycopy(seed, 0, sha1Input, 0, 20);

            int sha1InputOffset = 20;


            for(int j=0; j<dictionary.getRecipientsLength(); j++)
            {
                COSString string = dictionary.getRecipientStringAt(j);
                System.arraycopy(
                    string.getBytes(), 0,
                    sha1Input, sha1InputOffset, string.getBytes().length);
                sha1InputOffset += string.getBytes().length;
            }

            MessageDigest md = MessageDigest.getInstance("SHA-1");

            byte[] mdResult = md.digest(sha1Input);
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.cos.COSString

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.