Package org.pdfbox.cos

Examples of org.pdfbox.cos.COSBase


        }
        for( int i=0; i<array.size(); i++ )
        {
            COSName name = (COSName)array.get( i );
            i++;
            COSBase stream = array.get( i );
            PDNamedTextStream namedStream = new PDNamedTextStream( name, stream );
            namedStreams.add( namedStream );
        }
        return new COSArrayList( namedStreams, array );
    }
View Full Code Here


     * @throws IOException If there is an error getting the value.
     */
    public Object getValue() throws IOException
    {
        Object retval = null;
        COSBase value = field.getDictionaryObject( "V" );
        if( value instanceof COSName )
        {
            retval = ((COSName)value).getName();
        }
        else if( value instanceof COSArray )
View Full Code Here

     *
     * @throws IOException If there is an error setting the value.
     */
    public void setValue( Object value ) throws IOException
    {
        COSBase cos = null;
        if( value instanceof List )
        {
            cos = COSArrayList.convertStringListToCOSStringCOSArray( (List)value );
        }
        else if( value instanceof String )
View Full Code Here

        if( array != null )
        {
            List objects = new ArrayList();
            for( int i=0; i<array.size(); i++ )
            {
                COSBase next = array.getObject( i );
                if( next instanceof COSString )
                {
                    objects.add( ((COSString)next).getString() );
                }
                else
View Full Code Here

     *
     * @return The rich text XHTML stream.
     */
    public PDTextStream getRichText()
    {
        COSBase rv = field.getDictionaryObject( "RV" );
        return PDTextStream.createTextStream( rv );
    }
View Full Code Here

     *
     * @param wp The whitepoint tristimulus.
     */
    public void setWhitepoint( PDTristimulus wp )
    {
        COSBase wpArray = wp.getCOSObject();
        if( wpArray != null )
        {
            dictionary.setItem( COSName.getPDFName( "WhitePoint" ), wpArray );
        }
    }
View Full Code Here

     *
     * @param bp The BlackPoint tristimulus.
     */
    public void setBlackPoint( PDTristimulus bp )
    {
        COSBase bpArray = null;
        if( bp != null )
        {
            bpArray = bp.getCOSObject();
        }
        dictionary.setItem( COSName.getPDFName( "BlackPoint" ), bpArray );
View Full Code Here

     *
     * @throws IOException If there is an error getting the alternate color space.
     */
    public PDColorSpace getAlternateColorSpace() throws IOException
    {
        COSBase alternate = array.getObject( 2 );
        return PDColorSpaceFactory.createColorSpace( alternate );
    }
View Full Code Here

     *
     * @param cs The alternate color space.
     */
    public void setAlternateColorSpace( PDColorSpace cs )
    {
        COSBase space = null;
        if( cs != null )
        {
            space = cs.getCOSObject();
        }
        array.set( 2, space );
View Full Code Here

    public void setField(COSDocument doc, COSString name, COSString value)
    {
        for (Iterator i = doc.getObjects().iterator(); i.hasNext();)
        {
            COSObject obj = (COSObject) i.next();
            COSBase base = obj.getObject();
            if (base instanceof COSDictionary)
            {
                COSDictionary dict = (COSDictionary) base;
                COSBase type = dict.getItem(COSName.TYPE);
                if (type != null && type.equals(COSName.getPDFName("Annot")))
                {
                    COSBase subtype = dict.getItem(COSName.getPDFName("Subtype"));
                    if (subtype != null && subtype.equals(COSName.getPDFName("Widget")))
                    {
                        // we found the field
                        COSBase fname = dict.getItem(COSName.getPDFName("T"));
                        if (fname != null && fname.equals(name))
                        {
                            dict.setItem(COSName.getPDFName("V"), value);
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.pdfbox.cos.COSBase

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.