Examples of PDField


Examples of org.apache.pdfbox.pdmodel.interactive.form.PDField

                destAcroForm.setFields( destFields );
            }
            Iterator srcFieldsIterator = srcFields.iterator();
            while (srcFieldsIterator.hasNext())
            {
                PDField srcField = (PDField)srcFieldsIterator.next();
                PDField destField =
                    PDFieldFactory.createField(
                        destAcroForm,
                        (COSDictionary)cloneForNewDocument(destination, srcField.getDictionary() ));
                // if the form already has a field with this name then we need to rename this field
                // to prevent merge conflicts.
                if ( destAcroForm.getField(destField.getFullyQualifiedName()) != null )
                {
                    destField.setPartialName("dummyFieldName"+(nextFieldNum++));
                }
                destFields.add(destField);
            }
        }
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.form.PDField

                fdf = FDFDocument.load( fileFDF );
                PDAcroForm form = freedom.getDocumentCatalog().getAcroForm();
                form.importFDF( fdf );
                PDTextbox feld2 = (PDTextbox)form.getField( "eeFirstName" );
                List kids = feld2.getKids();
                PDField firstKid = (PDField)kids.get( 0 );
                PDField secondKid = (PDField)kids.get( 1 );
                testContentStreamContains( freedom, firstKid, "Steve" );
                testContentStreamContains( freedom, secondKid, "Steve" );
   
                //the appearance stream is suppose to be null because there
                //is an F action in the AA dictionary that populates that field.
                PDField totalAmt = form.getField( "eeSuppTotalAmt" );
                assertTrue( totalAmt.getDictionary().getDictionaryObject( "AP" ) == null );
   
            }
            finally
            {
                if( freedom != null )
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.form.PDField

                destAcroForm.setFields( destFields );
            }
            Iterator srcFieldsIterator = srcFields.iterator();
            while (srcFieldsIterator.hasNext())
            {
                PDField srcField = (PDField)srcFieldsIterator.next();
                PDField destField =
                    PDFieldFactory.createField(
                        destAcroForm,
                        (COSDictionary)cloneForNewDocument(destination, srcField.getDictionary() ));
                // if the form already has a field with this name then we need to rename this field
                // to prevent merge conflicts.
                if ( destAcroForm.getField(destField.getFullyQualifiedName()) != null )
                {
                    destField.setPartialName("dummyFieldName"+(nextFieldNum++));
                }
                destFields.add(destField);
            }
        }
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.form.PDField

            int r = currentRecursiveDepth+1;
            handler.startElement("ol");
            //TODO: can generate <ol/>. Rework to avoid that.
            for(COSObjectable pdfObj : kids) {
                if(pdfObj != null && pdfObj instanceof PDField) {
                    PDField kid = (PDField)pdfObj;
                    //recurse
                    processAcroField(kid, handler, r);
                }
            }
            handler.endElement("ol");
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.form.PDField

                destAcroForm.setFields( destFields );
            }
            Iterator srcFieldsIterator = srcFields.iterator();
            while (srcFieldsIterator.hasNext())
            {
                PDField srcField = (PDField)srcFieldsIterator.next();
                PDField destField =
                    PDFieldFactory.createField(
                        destAcroForm,
                        (COSDictionary)cloneForNewDocument(destination, srcField.getDictionary() ));
                // if the form already has a field with this name then we need to rename this field
                // to prevent merge conflicts.
                if ( destAcroForm.getField(destField.getFullyQualifiedName()) != null )
                {
                    destField.setPartialName("dummyFieldName"+(nextFieldNum++));
                }
                destFields.add(destField);
            }
        }
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.interactive.form.PDField

            int r = currentRecursiveDepth+1;
            handler.startElement("ol");
            //TODO: can generate <ol/>. Rework to avoid that.
            for(COSObjectable pdfObj : kids) {
                if(pdfObj != null && pdfObj instanceof PDField) {
                    PDField kid = (PDField)pdfObj;
                    //recurse
                    processAcroField(kid, handler, r);
                }
            }
            handler.endElement("ol");
View Full Code Here

Examples of org.pdfbox.pdmodel.annotation.interactive.PDField

        List fields = acroForm.getFields();
        Iterator fieldsIter = fields.iterator();

        while( fieldsIter.hasNext() )
        {
            PDField field = (PDField)fieldsIter.next();

            String outputString =
                field.getName() + "=" + field.toString() +
                " rect=" + field.getRectangle();

            System.out.println( outputString );
        }
    }
View Full Code Here

Examples of org.pdfbox.pdmodel.annotation.interactive.PDField

            for( int i=0; i<fields.size(); i++ )
            {
                COSDictionary fdfField = (COSDictionary)fields.getObject( i );
                COSString fieldName = (COSString)fdfField.getDictionaryObject( COSName.getPDFName( "T" ) );
                System.out.println( "Processing " + fieldName );
                PDField docField = acroForm.getField( fieldName.getString() );
                if( docField != null )
                {
                    docField.importFDF( fdfField );
                }
            }
        }
    }
View Full Code Here

Examples of org.pdfbox.pdmodel.annotation.interactive.PDField

     */
    public void setField( PDDocument pdfDocument, String name, String value ) throws IOException
    {
        PDDocumentCatalog docCatalog = pdfDocument.getDocumentCatalog();
        PDAcroForm acroForm = docCatalog.getAcroForm();
        PDField field = acroForm.getField( name );
        if( field != null )
        {
            field.setValue( value );
        }
        else
        {
            System.err.println( "No field found with name:" + name );
        }
View Full Code Here

Examples of org.pdfbox.pdmodel.interactive.form.PDField

     */
    public void setField( PDDocument pdfDocument, String name, String value ) throws IOException
    {
        PDDocumentCatalog docCatalog = pdfDocument.getDocumentCatalog();
        PDAcroForm acroForm = docCatalog.getAcroForm();
        PDField field = acroForm.getField( name );
        if( field != null )
        {
            field.setValue( value );
        }
        else
        {
            System.err.println( "No field found with name:" + name );
        }
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.