Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSName


            if( n instanceof COSDictionary )
            {
                List li = ((COSDictionary)n).keyList();
                for( int i=0; i<li.size(); i++ )
                {
                    COSName name = (COSName)li.get( i );
                    if( !name.equals( OFF_VALUE ))
                    {
                        value = name;
                    }
                }
               
View Full Code Here


     */
    public boolean isChecked()
    {
        boolean retval = false;
        String onValue = getOnValue();
        COSName radioValue = (COSName)getDictionary().getDictionaryObject( KEY );
        if( radioValue != null && value != null && radioValue.getName().equals( onValue ) )
        {
            retval = true;
        }
       
        return retval;
View Full Code Here

        throws IOException
    {
        Object retval = null;
        if( dictionary != null )
        {
            COSName filter = (COSName)dictionary.getDictionaryObject( COSName.FILTER );
            Class handlerClass = (Class)handlerMap.get( filter );
            if( handlerClass == null )
            {
                throw new IOException( "No handler for security handler '" + filter.getName() + "'" );
            }
            else
            {
                try
                {
View Full Code Here

    {
        PageDrawer drawer = (PageDrawer)context;
        PDPage page = drawer.getPage();
        Dimension pageSize = drawer.getPageSize();
        Graphics2D graphics = drawer.getGraphics();
        COSName objectName = (COSName)arguments.get( 0 );
        Map xobjects = drawer.getResources().getXObjects();
        PDXObject xobject = (PDXObject)xobjects.get( objectName.getName() );
        if( xobject instanceof PDXObjectImage )
        {
            PDXObjectImage image = (PDXObjectImage)xobject;
            try
            {
View Full Code Here

        throws CryptographyException, IOException
    {
        Iterator keys = dictionary.keyList().iterator();
        while( keys.hasNext() )
        {
            COSName key = (COSName)keys.next();
            Object value = dictionary.getItem( key );
            //if we are a signature dictionary and contain a Contents entry then
            //we don't decrypt it.
            if( !(key.getName().equals( "Contents" ) &&
                  value instanceof COSString &&
                  potentialSignatures.contains( dictionary )))
            {
                decrypt( value, objNum, genNum );
            }
View Full Code Here

     * @throws Exception If there is an exception while parsing.
     */
    public void testCOSName() throws Exception
    {
        TestParser parser = new TestParser(new ByteArrayInputStream( "/PANTONE#20116#20CV".getBytes() ) );
        COSName name = parser.parseCOSName();
        assertTrue("Failed to parse COSName",name.getName().equals( "PANTONE 116 CV" ));
       
    }
View Full Code Here

        {
            Map actualMap = new HashMap();
            Iterator keyIter = map.keyList().iterator();
            while( keyIter.hasNext() )
            {
                COSName key = (COSName)keyIter.next();
                COSBase cosObj = map.getDictionaryObject( key );
                Object actualObject = null;
                if( cosObj instanceof COSString )
                {
                    actualObject = ((COSString)cosObj).getString();
                }
                else if( cosObj instanceof COSInteger )
                {
                    actualObject = new Integer( ((COSInteger)cosObj).intValue() );
                }
                else if( cosObj instanceof COSName )
                {
                    actualObject = ((COSName)cosObj).getName();
                }
                else if( cosObj instanceof COSFloat )
                {
                    actualObject = new Float( ((COSInteger)cosObj).floatValue() );
                }
                else if( cosObj instanceof COSBoolean )
                {
                    actualObject = ((COSBoolean)cosObj).getValue() ? Boolean.TRUE : Boolean.FALSE;
                }
                else
                {
                    throw new IOException( "Error:unknown type of object to convert:" + cosObj );
                }
                actualMap.put( key.getName(), actualObject );
            }
            retval = new COSDictionaryMap( actualMap, map );
        }
       
        return retval;
View Full Code Here

    {
        List retval = null;
        COSBase filters = stream.getFilters();
        if( filters instanceof COSName )
        {
            COSName name = (COSName)filters;
            retval = new COSArrayList( name.getName(), name, stream, "Filter" );
        }
        else if( filters instanceof COSArray )
        {
            retval = COSArrayList.convertCOSNameCOSArrayToList( (COSArray)filters );
        }
View Full Code Here

    {
        List retval = null;
        COSBase filters = stream.getDictionaryObject( "FFilter" );
        if( filters instanceof COSName )
        {
            COSName name = (COSName)filters;
            retval = new COSArrayList( name.getName(), name, stream, "FFilter" );
        }
        else if( filters instanceof COSArray )
        {
            retval = COSArrayList.convertCOSNameCOSArrayToList( (COSArray)filters );
        }
View Full Code Here

    {
        List retval = null;
        COSBase filters = dictionary.getDictionaryObject( new String[] {"Filter", "F"} );
        if( filters instanceof COSName )
        {
            COSName name = (COSName)filters;
            retval = new COSArrayList( name.getName(), name, dictionary, "Filter" );
        }
        else if( filters instanceof COSArray )
        {
            retval = COSArrayList.convertCOSNameCOSArrayToList( (COSArray)filters );
        }
View Full Code Here

TOP

Related Classes of org.pdfbox.cos.COSName

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.