How to call doc2any.exe from java?

In this article, I will take converting xls to swf for example to show you how to call doc2any from java. This way is also helpful for converting all the printable file to PDF, image or others when you need to do the conversion together with other application like java, c# or others. The full name of doc2any is VeryDOC DOC to Any Converter which was developed by VeryPDF software company. If you would like to have a free trial, you can download it to your PC, here is the link for you,https://www.verydoc.com/images/download2.gif. If you need to know more about it, you can visit its official homepage.

Filename: FileConversion.java
Source Code:

import java.io.*;

public class FileConversion
{
    public static void main(String args[])throws IOException
    {
    try
    {
        Runtime runTime = Runtime.getRuntime();
        Process process = runTime.exec("\"C:\\Documents and Settings\\admin\\My Documents\\Downloads\\doc2any_cmd\\doc2any_cmd\\doc2any.exe\" \"-useprinter\" \"-useoffice\" \"1\" \"C:\\example.xls\" \"C:\\pavan.swf\"");
        BufferedReader input = new BufferedReader(new InputStreamReader(process.getInputStream()));
        String line=null;
        while((line=input.readLine()) != null)
        {
        System.out.println(line);
        }
    }
    catch(Exception exc)
    {
        System.out.println(exc.toString());
        exc.printStackTrace();
    }
    }
}

====================================

>javac FileConversion.java
>java   FileConversion

If you need to know more about this conversion or other file formats conversion,  you can contact us by the ways supported on this website.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

One Reply to “How to call doc2any.exe from java?”

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!