Tutorials

How to convert PDF to Word in Java

Tutorials

How to convert PDF to Word in Java

You can run PDFConvert command-line interface from many programming languages such as C++, C#, ASP, JAVA or Delphi etc.

The Java source code below shows how to convert a PDF file ("c:\pdf\demo.pdf") to Word file ("c:\word\demo.docx"). This code has been tested in Eclipse Kepler 4.3.2.

Java source code sample:
  import java.io.*;
	
  class PDFConvert{

    public static void main(String[] args) throws IOException, InterruptedException
    {
      //Replace PDFConvert directory, source PDF file name and output directory
      String command = "\"C:\\Program Files (x86)\\PDFConvert\\pdfconvert.exe\" /cs 10000 /i \"c:\\pdf\\demo.pdf\" /o \"c:\\word\" /pwo 2";
      Process p = Runtime.getRuntime().exec(command);
      System.out.println("Conversion complete!");
    }//end main

  }

Check more information of PDFConvert command-line interface.

command line