Examples of PDField


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

       
        System.out.println(new Integer(fields.size()).toString() + " top-level fields were found on the form");

        while( fieldsIter.hasNext())
        {
            PDField field = (PDField)fieldsIter.next();
               processField(field, "|--", field.getPartialName());
        }
    }
View Full Code Here

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

            while(kidsIter.hasNext())
            {
               Object pdfObj = kidsIter.next();
               if(pdfObj instanceof PDField)
               {
                   PDField kid = (PDField)pdfObj;
                   processField(kid, "|  " + sLevel, sParent);
               }                  
            }
         }
         else
View Full Code Here

Examples of org.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.pdfbox.pdmodel.interactive.form.PDField

            fdf = FDFDocument.load( "test/input/FreedomExpressions.fdf" );
            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.pdfbox.pdmodel.interactive.form.PDField

  }

  public String getValue() {
    try
    {
      final PDField parent = field_.getParent();
      final PDField field = parent != null ? parent : field_;

      String value = field.getValue();
      if (value == null)
        value = PdfBoxPDFPage.stringValue(field.getDictionary().getDictionaryObject(COSName.DV));
     
      return value;
    }
    catch (final IOException e) {
      throw new RuntimeException("Can't read field value", e);
View Full Code Here

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

    static FieldPredicate buildNamePredicate(final String name)
    {
      return new FieldPredicate()
      {
        protected boolean evaluateField(final PDField field) throws IOException {
          final PDField parent = field.getParent();
          final String fieldName;
          if (parent != null)
            fieldName = parent.getFullyQualifiedName();
          else
            fieldName = field.getFullyQualifiedName();
          return name.equals(fieldName);
        }
      };
View Full Code Here

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

        try
        {
          if (acroForm != null) {
              final List fields = acroForm.getFields();
              for (final Iterator iter = fields.iterator(); iter.hasNext();) {
                  final PDField field = (PDField) iter.next();
                  final List kids = field.getKids();
                  if (kids != null && !kids.isEmpty())
                  {
                    for (final Iterator iterKids = kids.iterator(); iterKids.hasNext();) {
                            final PDField childField = (PDField) iterKids.next();
                          if (filter.evaluate(childField))
                             {
                            response.add(PdfBoxPDFField.wrap(childField));
                             }
            }
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.