title: convert pdf editable fields into text using java programming
body: <p>I have prepared one editable form But unable to convert pdf editable fields into text using java programming.</p>
  
  <p>Used API – pdfbox-app-2.0.0-RC2, PDFBox-0.7.3, itextpdf-5.1.0, pdfclown.</p>
  
  <p>Pleas help me to find out how to convert pdf editable fields into text in java. </p>
  
  <p>used java program (able to convert normal pdf into text but not converting pdf editable fields into text ).</p>
  
  <pre><code>import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.FileReader;
  import java.io.FileWriter;
  import java.io.BufferedWriter;
  import java.io.IOException;
  import com.itextpdf.text.Document;
  import com.itextpdf.text.pdf.PdfReader;
  import com.itextpdf.text.pdf.parser.PdfTextExtractor;
  import java.awt.Desktop;
  import javax.swing.filechooser.FileNameExtensionFilter;
  import javax.swing.JFileChooser;
  
  public class PdfConvertor_1{
   public static void main(String[] args){
    selectPDFFiles();
   }
  
  
   //allow pdf files selection for converting
   public static void selectPDFFiles(){
  
    JFileChooser chooser = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter("PDF","pdf");
        chooser.setFileFilter(filter);
        chooser.setMultiSelectionEnabled(true);
        int returnVal = chooser.showOpenDialog(null);
        if(returnVal == JFileChooser.APPROVE_OPTION) {
                 File[] Files=chooser.getSelectedFiles();
                 System.out.println("Please wait...");
                 for( int i=0;i&lt;Files.length;i++){     
                  convertPDFToText(Files[i].toString(),"textfrompdf"+i+".txt");
                  }
     System.out.println("Conversion complete");
                  }
  
    }
  
   public static void convertPDFToText(String src,String desc){
    try{
     //create file writer
     FileWriter fw=new FileWriter("D:\\POC_Pdf2.txt");
     //create buffered writer
     BufferedWriter bw=new BufferedWriter(fw);
     //create pdf reader
     PdfReader pr=new PdfReader(src);
     //get the number of pages in the document
     int pNum=pr.getNumberOfPages();
     //extract text from each page and write it to the output text file
     for(int page=1;page&lt;=pNum;page++){
      String text=PdfTextExtractor.getTextFromPage(pr, page);
      bw.write(text);
      bw.newLine();
  
     }
     bw.flush();
     bw.close();
  
  
  
    }catch(Exception e){e.printStackTrace();}
  
   }
  
  }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/huZ4k.jpg" rel="nofollow">Please check editable fields in image which i want to convert in to text using java</a></p>