Package org.pdfbox.pdmodel.interactive.form

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


     * @throws IOException If there is an error setting the data in the field.
     */
    public void importFDF( PDDocument pdfDocument, FDFDocument fdfDocument ) throws IOException
    {
        PDDocumentCatalog docCatalog = pdfDocument.getDocumentCatalog();
        PDAcroForm acroForm = docCatalog.getAcroForm();
        acroForm.setCacheFields( true );
        acroForm.importFDF( fdfDocument );
    }
View Full Code Here


                usage();
            }
            else
            {
                pdf = PDDocument.load( args[0] );
                PDAcroForm form = pdf.getDocumentCatalog().getAcroForm();
                if( form == null )
                {
                    System.err.println( "Error: This PDF does not contain a form." );
                }
                else
                {
                    String fdfName = null;
                    if( args.length == 2 )
                    {
                        fdfName = args[1];
                    }
                    else
                    {
                        if( args[0].length() > 4 )
                        {
                            fdfName = args[0].substring( 0, args[0].length() -4 ) + ".fdf";
                        }
                    }
                    fdf = form.exportFDF();
                    fdf.save( fdfName );
                }
            }
        }
        finally
View Full Code Here

    }
  }
 
  protected List getFields(final Predicate filter)
  {
        final PDAcroForm acroForm = getPDFDocument().getDocumentCatalog().getAcroForm();
        final List response = new ArrayList();

        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())
                  {
View Full Code Here

TOP

Related Classes of org.pdfbox.pdmodel.interactive.form.PDAcroForm

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.