Examples of COSDictionary


Examples of org.pdfbox.cos.COSDictionary

     * @param theAcroForm The form that this field is part of.
     */
    public PDField( PDAcroForm theAcroForm )
    {
        acroForm = theAcroForm;
        dictionary = new COSDictionary();
        //no required fields in base field class
    }
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

    private String findFieldType( COSDictionary dic )
    {
        String retval = dic.getNameAsString( "FT" );
        if( retval == null )
        {
            COSDictionary parent = (COSDictionary)dic.getDictionaryObject( "Parent", "P" );
            if( parent != null )
            {
                retval = findFieldType( parent );
            }
        }
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

     * @throws IOException If there is an error creating the parent field.
     */
    public PDField getParent() throws IOException
    {
        PDField parent = null;
        COSDictionary parentDic = (COSDictionary)getDictionary().getDictionaryObject( "Parent" );
        if( parentDic != null )
        {
            parent = PDFieldFactory.createField( getAcroForm(), parentDic );
        }
        return parent;
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

        COSArray kids = (COSArray)getDictionary().getDictionaryObject( COSName.KIDS );
        if( kids != null )
        {
            for (int i = 0; retval == null && i < kids.size(); i++)
            {
                COSDictionary kidDictionary = (COSDictionary)kids.getObject(i);
                if( name[nameIndex].equals( kidDictionary.getString( "T" ) ) )
                {
                    retval = PDFieldFactory.createField( acroForm, kidDictionary );
                    if( name.length > nameIndex+1 )
                    {
                        retval = retval.findKid( name, nameIndex+1 );
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

        if( kids != null )
        {
            List kidsList = new ArrayList();
            for (int i = 0; i < kids.size(); i++)
            {
                COSDictionary kidDictionary = (COSDictionary)kids.getObject(i);
                COSDictionary parent = (COSDictionary)kidDictionary.getDictionaryObject( "Parent" );
                if( kidDictionary.getDictionaryObject( "FT" ) != null ||
                    (parent != null && parent.getDictionaryObject( "FT" ) != null ) )
                {
                    kidsList.add( PDFieldFactory.createField( acroForm, kidDictionary ));
                }
                else if( "Widget".equals( kidDictionary.getNameAsString( "Subtype" ) ) )
                {
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

     *
     * @return The actions of the field.
     */
    public PDFormFieldAdditionalActions getActions()
    {
        COSDictionary aa = (COSDictionary)dictionary.getDictionaryObject( "AA" );
        PDFormFieldAdditionalActions retval = null;
        if( aa != null )
        {
            retval = new PDFormFieldAdditionalActions( aa );
        }
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

     * Default constructor.
     *
     */
    public PDThreadBead()
    {
        bead = new COSDictionary();
        bead.setName( "Type", "Bead" );
        setNextBead( this );
        setPreviousBead( this );
    }
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

     * @return The thread that this bead is part of.
     */
    public PDThread getThread()
    {
        PDThread retval = null;
        COSDictionary dic = (COSDictionary)bead.getDictionaryObject( "T" );
        if( dic != null )
        {
            retval = new PDThread( dic );
        }
        return retval;
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

     * @return The page that this bead is part of.
     */
    public PDPage getPage()
    {
        PDPage page = null;
        COSDictionary dic = (COSDictionary)bead.getDictionaryObject( "P" );
        if( dic != null )
        {
            page = new PDPage( dic );
        }
        return page;
View Full Code Here

Examples of org.pdfbox.cos.COSDictionary

        if( c != '<')
        {
            throw new IOException( "expected='<' actual='" + c + "' " + pdfSource );
        }
        skipSpaces();
        COSDictionary obj = new COSDictionary();
        boolean done = false;
        while( !done )
        {
            skipSpaces();
            c = (char)pdfSource.peek();
            if( c == '>')
            {
                done = true;
            }
            else
            {
                COSName key = parseCOSName();
                COSBase value = parseCOSDictionaryValue();
                skipSpaces();
                if( ((char)pdfSource.peek()) == 'd' )
                {
                    //if the next string is 'def' then we are parsing a cmap stream
                    //and want to ignore it, otherwise throw an exception.
                    String potentialDEF = readString();
                    if( !potentialDEF.equals( DEF ) )
                    {
                        pdfSource.unread( potentialDEF.getBytes() );
                    }
                    else
                    {
                        skipSpaces();
                    }
                }

                if( value == null )
                {
                    throw new IOException("Bad Dictionary Declaration " + pdfSource );
                }
                obj.setItem( key, value );
            }
        }
        char ch = (char)pdfSource.read();
        if( ch != '>' )
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.