List of usage examples for org.apache.pdfbox.pdmodel.interactive.form PDField getFieldType
public abstract String getFieldType();
From source file:pdf.to.info.PDF.java
/** * Reading fields of a PDF file//w ww .j av a 2 s . co m * * @param filePath * @throws java.io.IOException */ public void PdfFields(String filePath) throws IOException { PDDocument pdDoc = ReadPDDoc(filePath); PDAcroForm form = pdDoc.getDocumentCatalog().getAcroForm(); if (form != null) { List FieldTy = form.getFields(); PDField pdfFields; for (int i = 0; i < FieldTy.size(); i++) { pdfFields = (PDField) FieldTy.get(i); String fieldNameTyope = pdfFields.getFieldType(); System.out.println(fieldNameTyope); } } else { System.out.print("There is no standard field in your PDF file.\n"); } }