pdfbox. how to fetch fields of all kind of pdf forms
<p>I am able to fetch the field names for most of the pdf files using pdfbox but i am not able to fetch fields income taxform. is it  something restricted in that form.</p>

<p>though it contains multiple fields in the form, it is showing only one field.</p>

<p>This is the output:</p>

<p>topmostSubform[0].</p>

<p>my code:</p>

<pre><code>PDDocumentCatalog docCatalog = pdfDocument.getDocumentCatalog();
PDAcroForm acroForm = docCatalog.getAcroForm();
List fields = acroForm.getFields();

@SuppressWarnings("rawtypes")
java.util.Iterator fieldsIter = fields.iterator();
System.out.println(new Integer(fields.size()).toString());
while( fieldsIter.hasNext())
{
    PDField field = (PDField)fieldsIter.next();
    System.out.println(field.getFullyQualifiedName());
    System.out.println(field.getPartialName());
}
</code></pre>

<p>used in</p>

<pre><code>public static void main(String[] args) throws IOException {
    PDDocument pdDoc = null;
    try {
        pdDoc = PDDocument.load("income.pdf");
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace(); 
    }
    Ggdfgdgdgf feilds = new Ggdfgdgdgf();
    feilds.printFields(pdDoc);
}
</code></pre>