Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSString


     * @throws IOException If there is an error accessing the data.
     */
    public byte[] getUserKey() throws IOException
    {
        byte[] u = null;
        COSString user = (COSString)encryptionDictionary.getDictionaryObject( COSName.getPDFName( "U" ) );
        if( user != null )
        {
            u = user.getBytes();
        }
        return u;
    }
View Full Code Here


    public void setRecipients(byte[][] recipients) throws IOException
    {       
        COSArray array = new COSArray();
        for(int i=0; i<recipients.length; i++)
        {
            COSString recip = new COSString();
            recip.append(recipients[i]);
            recip.setForceLiteralForm(true);           
            array.add(recip);
        }
        encryptionDictionary.setItem(COSName.getPDFName("Recipients"), array);
    }
View Full Code Here

        Map normalAppearance = widget.getAppearance().getNormalAppearance();
        PDAppearanceStream appearanceStream = (PDAppearanceStream)normalAppearance.get( "default" );
        COSStream actual = appearanceStream.getStream();
       
        List actualTokens = getStreamTokens( doc, actual );
        assertTrue( actualTokens.contains( new COSString( expected ) ) );
    }
View Full Code Here

     * @throws IOException If there is an exception while encoding.
     */
    public void testUnicode() throws IOException
    {
        String theString = "\u4e16";
        COSString string = new COSString( theString );
        assertTrue( string.getString().equals( theString ) );
    }
View Full Code Here

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

            Collections.sort( keys );
            COSArray array = new COSArray();
            for( int i=0; i<keys.size(); i++ )
            {
                String key = (String)keys.get(i);
                array.add( new COSString( key ) );
                COSObjectable obj = (COSObjectable)names.get( key );
                array.add( obj );
            }
            String lower = null;
            String upper = null;
View Full Code Here

     * Constructor.
     *
     */
    public PDSimpleFileSpecification()
    {
        file = new COSString( "" );
    }
View Full Code Here

     *
     * @param fileName The name of the file.
     */
    public void setFile( String fileName )
    {
    file = new COSString( fileName );
    }
View Full Code Here

     *
     * @param str The string parameter.
     */
    public PDTextStream( String str )
    {
        string = new COSString( str );
    }
View Full Code Here

            parentDict = null;
        }
        //string is a special case because we can't subclass to be COSObjectable
        if( o instanceof String )
        {
            array.add( new COSString( (String)o ) );
        }
        else if( o instanceof DualCOSObjectable )
        {
            DualCOSObjectable dual = (DualCOSObjectable)o;
            array.add( dual.getFirstCOSObject() );
View Full Code Here

TOP

Related Classes of org.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.