Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSArray


     * @param width The width of the rectangle.
     * @param height The height of the rectangle.
     */
    public PDRectangle( float width, float height )
    {
        rectArray = new COSArray();
        rectArray.add( new COSFloat( 0.0f ) );
        rectArray.add( new COSFloat( 0.0f ) );
        rectArray.add( new COSFloat( width ) );
        rectArray.add( new COSFloat( height ) );
    }
View Full Code Here


     *
     * @param box The non PD bouding box.
     */
    public PDRectangle( BoundingBox box )
    {
        rectArray = new COSArray();
        rectArray.add( new COSFloat( box.getLowerLeftX() ) );
        rectArray.add( new COSFloat( box.getLowerLeftY() ) );
        rectArray.add( new COSFloat( box.getUpperRightX() ) );
        rectArray.add( new COSFloat( box.getUpperRightY() ) );
    }
View Full Code Here

     */
    public List getKids()
    {
       
        List retval = null;
        COSArray kids = (COSArray)node.getDictionaryObject( "Kids" );
        if( kids != null )
        {
            List pdObjects = new ArrayList();
            for( int i=0; i<kids.size(); i++ )
            {
                pdObjects.add( createChildNode( (COSDictionary)kids.getObject(i) ) );
            }
            retval = new COSArrayList(pdObjects,kids);
        }
       
        return retval;
View Full Code Here

     * @throws IOException If there is an error while creating the sub types.
     */
    public Map getNames() throws IOException
    {
        Map names = null;
        COSArray namesArray = (COSArray)node.getDictionaryObject( "Names" );
        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);
View Full Code Here

        }
        else
        {
            List keys = new ArrayList( names.keySet() );
            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;
            if( keys.size() > 0 )
            {
View Full Code Here

     * @return The highest value for a key in the map.
     */
    public String getUpperLimit()
    {
        String retval = null;
        COSArray arr = (COSArray)node.getDictionaryObject( "Limits" );
        if( arr != null )
        {
            retval = arr.getString( 1 );
        }
        return retval;
    }
View Full Code Here

     *
     * @param upper The new highest value for a key in the map.
     */
    private void setUpperLimit( String upper )
    {
        COSArray arr = (COSArray)node.getDictionaryObject( "Limits" );
        if( arr == null )
        {
            arr = new COSArray();
            arr.add( null );
            arr.add( null );
        }
        arr.setString( 1, upper );
    }
View Full Code Here

     * @return The lowest value for a key in the map.
     */
    public String getLowerLimit()
    {
        String retval = null;
        COSArray arr = (COSArray)node.getDictionaryObject( "Limits" );
        if( arr != null )
        {
            retval = arr.getString( 0 );
        }
        return retval;
    }
View Full Code Here

     *
     * @param lower The new lowest value for a key in the map.
     */
    private void setLowerLimit( String lower )
    {
        COSArray arr = (COSArray)node.getDictionaryObject( "Limits" );
        if( arr == null )
        {
            arr = new COSArray();
            arr.add( null );
            arr.add( null );
        }
        arr.setString( 0, lower );
    }
View Full Code Here

    /**
     * Constructor.
     */
    public PDMatrix()
    {
        matrix = new COSArray();
        matrix.add( new COSFloat( 1.0f ) );
        matrix.add( new COSFloat( 0.0f ) );
        matrix.add( new COSFloat( 0.0f ) );
        matrix.add( new COSFloat( 0.0f ) );
        matrix.add( new COSFloat( 1.0f ) );
View Full Code Here

TOP

Related Classes of org.pdfbox.cos.COSArray

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.