How to using the executable software in Java

I got a software named: pdf to text convertor; which can format the text interface from the pdf, for example, you need add the page number with a4 paper, then the convertor can change the pdf into text with page numbers. it is running on the doc, the command like: c:\pdfconvertor\xpdfrc.exe "c:\filename\name.pdf", after the text file will exist in the same directory with the pdf file.
so my problem is how to use java to call this DOS command to execute the program, and then java can read the text file, does some one give me some idea? better with simple java code!! Thanks very much! I will pay dollar for the solutions

You can use:
String[] cmd = {"c:\\pdfconvertor\\xpdfrc.exe", "c:\\filename\\name.pdf"};
Process p = Runtime.getRuntime().exec(cmd);Wait for the process to finish:
p.waitFor()and do your thing with the output file.
Note there are mechanisms for capturing the input and output of the subprocess; see java.lang.Process javadoc.

Similar Messages

  • How to use the TCP/IP in Java?Thanks!

    How to use the TCP/IP in Java?Thanks!

    Look at the java.net package, more specifically to classes ServerSocket (The server TPC conection) and Socket (the client TCP conection)
    Abraham

  • How to use the random generator in java

    hey peeps, this is the class in which i am trying to implement the random generator in;
    public class Matchlist
        private studentdetails sd = new studentdetails();
        /** matchList StringBuilder stores the match list in progress */
        private StringBuilder matchList = new StringBuilder();
        private int loop = 0;
        private int matches = 0;
        public Matchlist()
            sd.createstudentdetails();
        /** Method to create the actual match list, returns the list as a string */
        public String CreateMatch()
            int g;
            int y;
                for (g = 0; g < 4; g++)//g = game
                    for (y = 17; y > -1; y--)//y = green house
                        /** Check to see if the game is empty */
                        if (sd.getgh(y).getGame(g).equalsIgnoreCase(""))
                            for (int x = 0; x < 18; x++) //x = yellow house
                                if (sd.getyh(x).getGame(g).equalsIgnoreCase(""))
                                    if (sd.getgh(y).getC_lass() != sd.getyh(x).getC_lass())
                                        /** Check to see if the person has played the other person */
                                        if (sd.getgh(y).checkPlayed(sd.getyh(x).getName()) == false)
                                            /** Set the game to the name of the opponent played */
                                            sd.getyh(x).changeGame(g, sd.getgh(y).getName());
                                            sd.getgh(y).changeGame(g, sd.getyh(x).getName());
                                            /** Build the match list step by step using append with \n at the end to create a new line */
                                            matchList.append(sd.getyh(x).getName() + " vs " + sd.getgh(y).getName() + "\n");
                                            matches++;
                                            break;
                /** Convert the stringbuilder into an actual string, then return it */
                String completeMatchList = matchList.toString();
                System.out.println(matches);
                for (int i = 0; i <18; i++)
                    sd.getyh(i).getEmptyMatches();
                    sd.getgh(i).getEmptyMatches();
                return completeMatchList;
        }what i dont understand is how to implement it to pick my matches at random using the http://java.sun.com/j2se/1.4.2/docs/api/java/util/Random.html java tutorials from here
    regards

    How to use Random ?
    First you open API then you read it, then you use it.
    You mention you try to use it but i just see a horrible nested for for for if if if loop.
    Restructure code and question and maybe it makes more sense.
    Edited by: pgeuens on 10-mrt-2008 22:58

  • How to use the Worklist API from Java (classpath ??)

    Hi all,
    Sorry for a novice question but I couldn't find the way to go about this (probably because it's such common knowldge...)
    I would like to try and use the Worklist API from my Java code in Eclipse, and according to the BPEL dev-guide I need to add an Import command for oracle.tip.pc.api.worklist. Where do I find these classes ?????
    I guess I need to change my CLASSPATH but I couldn't find a single word about this in the BPEL dev-guide (chapter 17), BPEL installation guide or elseware.
    thanks.

    Hi all,
    Ok now.
    To summarize - I was trying the code from BPEL developer guide, chapter 17, page 40 for using the Worklist local API's.
    Only after adding the following JAR's to the build path, was I able to compile it:
    orabpel-common.jar
    orabpel.jar
    bpm-infra.jar
    bpm-services.jar
    So, these 4 JAR's are required for using the Worklist local API's (not a clue in the dev guide itself for this requirement though...)
    Thank you very much for your help,
    assaf.

  • How to use the Rc4DLL.dll with java (jre1.4 )

    I am not able to use Rc4DLL.dll with java, there are some characters (encrypted using Rc4DLL.dll) that java is not able to identify. So while decrypting in java using Rc4DLL I am not getting the desired output (as some character java tries to decrypt are not supported with java). Could some one give a solution of using Rc4DLL with java jre 1.4

    RC4 cipher is supported by 1.4.
    And surely you can turn a link to the 1.5.0 JCE Reference Guide into a link to the 1.4.2 Reference Guide? I did. Took me 5 seconds to check that. As opposed to wasting a day and a half in forums like you just did.

  • I share a macbook with my other half and we both use it for our iphones. When syncing using the new software I now have all of her and my contacts on my phone.  I don't want her contacts! How do I get rid?

    I share a macbook with my other half and we both use it for our iphones. When syncing using the new software I now have all of her and my contacts on my phone.  I don't want her contacts! How do I get rid?

    Hi,
    You have 2 solutions:
    1 - You can use 2 differents icloud account
    2 - You use the same account but you don't sync yours contacts.
    You configure that in  Settings > icloud
    You activate or desactivate what you want.
    Have a nice day.

  • How to Use the JAVA SCRIPT code in .htm page of the component

    Hi .
    In my requirement i have to use Java Script Function in .htm code ..how to use the java script code and functions in .htm???
    thank you
    B.Mani

    Check this document  [Arun's Blog|http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebClientUI-TalkingwithJava+Script]
    Regards
    Kavindra

  • HT201250 I had to replace the hard drive in my old MacBook. I replaced it. Installed OSX10.6. Then using the system software I reinstalled data from my Time Machine backup. On completion it asked for my password. It is not accepted. I am locked out how I

    I had to replace the hard drive in my old MacBook. I replaced it. Installed OSX10.6. Then using the system software I reinstalled data from my Time Machine backup. On completion it asked for my password. It is not accepted. I am locked out how I overcome this?
    I was already using 10.7. But only had the disc for 10.6.

    Sorry I am new to this. Am I in the right area? I am using my iPhone to make contact. I am worried.

  • How to use the Java embedding activity in BPel

    hi all,
    How to use the java embedding activity in BPEL
    pls can u provide sample example

    1 Use [Oracle BPEL Process Manager Client Java API Reference|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/overview-summary.html] and especially [com.collaxa.cube.engine.ext|http://download-uk.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/com/collaxa/cube/engine/ext/BaseBPELXExecLet.html]
    Instead of System.Out.println use addAuditTrailEntry(java.lang.String message)
    2. If you want to import a package write in code (Source View) of bpel process
    +<bpelx:exec import="package_name"/>+ for example +<bpelx:exec import="java.util.regex.Matcher"/>+
    example 1:
    String bodyAsString;
    StringBuffer myStringBuffer = new StringBuffer();
    try {
    bodyAsString = (String)getVariableData("BodyString");
    addAuditTrailEntry("bodyAsString1: "+ bodyAsString);
    Pattern pattern = Pattern.compile("goodDay");
    Matcher matcher= pattern.matcher(bodyAsString);
    while (matcher.find()) {   
    matcher.appendReplacement(myStringBuffer, "shitDay");
    matcher.appendTail(myStringBuffer);
    bodyAsString = myStringBuffer.toString();
    addAuditTrailEntry("bodyAsString2: "+ bodyAsString);
    } catch (Exception ex) {
    addAuditTrailEntry("Failed+bodyAsString",ex.getMessage());
    I put in code (Source View) the following
    <bpelx:exec import="java.util.regex.Matcher"/>
    <bpelx:exec import="java.util.regex.Pattern"/>
    example2:
    Object temp;
    try {
    temp = ((XMLElement)getVariableData("inputVariable","payload","/ns2:FiscalisMessage/ns2:Body")).getChildNodes().item(1);
    setVariableData("AdjReceipt",temp);
    addAuditTrailEntry("ok",temp.toString());
    catch (Exception ex) {
    addAuditTrailEntry("Failed :",ex);
    I put in code (Source View) the following
    <bpelx:exec import="oracle.xml.parser.v2.XMLElement"/>

  • How to use the Bloggie camera with Apple iMovie software.

    Solved!
    Go to Solution.

    Follow these steps to use the Bloggie® camera with the Apple® iMovie® program.
    Power on the camera and connect directly to a USB port on the computer.
    Once the camera is detected by your computer, the iMovie software should open automatically. If the iMovie software does not open automatically, go to the Applicationsfolder and open it from there.
    In the iMovie window, choose Import from Camera...
    Choose which clips you want to import and choose the Done button or choose the Import All...button to import all the clips.
    NOTE: You can use the standard iMovie interface to edit and create movies from your video taken with the camera. For more information about how to use the iMovie program, refer to the Help menu in iMovie or visit http://www.apple.com/support/imovie.

  • How to upload pictures to Facebook using the Bloggie Software

    If you have any further questions please feel free to ask away. I will do my best to find the answer you are looking for!
    - Patrick

    Sony wants your feedback! http://bit.ly/WcYjMO
    This video will show you how to upload pictures to Facebook using the Bloggie Software.
    If you have any further questions please feel free to ask away. I will do my best to find the answer you are looking for!
    - Patrick

  • How do you delete photo's and also how do you search in your phone for apps/anything using the latest software

    how do you delete photo's and also how do you search your phonefor apps / anything ???
    i am using the latest software update
    many thanx to all in advance

    Anywhere on a home page swipe down (not from the very top or you'll get the Notification Center) to launch Spotlight.

  • How to upload movies to YouTube using the Bloggie Software

    If you have any further questions please feel free to ask away. I will do my best to find the answer you are looking for!
    - Patrick
    Solved!
    Go to Solution.

    Sony wants your feedback! http://bit.ly/WcYjMO
    This video will show you how to upload movies to YouTube using the Bloggie Software.
    If you have any further questions please feel free to ask away. I will do my best to find the answer you are looking for!
    - Patrick

  • How to upload photos to Flickr photo sharing using the Bloggie Software

    If you have any further questions please feel free to ask away. I will do my best to find the answer you are looking for!
    - Patrick
    Solved!
    Go to Solution.

    Sony wants your feedback! http://bit.ly/WcYjMO
    This video will show you how to upload photos to Flickr photo sharing service using the Bloggie Software.
    If you have any further questions please feel free to ask away. I will do my best to find the answer you are looking for!
    - Patrick

  • How to use the DLLs which created from c++ in Java?

    And How to use the DLLs which created from JNI in C++?

    Huh?
    Are you asking how to do JNI - you should read the tutorial.
    Are you asking how to load it - then use System.loadLibrary()
    Are you asking what to do with the output from javah - put it in a C file and write some code, compile it into a dll.

Maybe you are looking for

  • Using an asset as a button

    Hey guys, I have a question about buttons, and using an asset under the "style" tab of the inspector. The file I want to use for a rollover is too complicated for an overlay, but looks fine when I add it as an asset to the button. The only problem is

  • Mat.is in unrestrictd status in MMBE but its not showin in vl10i unrestrctd

    Hello Experts, we are facing a very strange issue. we have material in an unrestricted status in MMBE - but it is not showing in unrestricted in VL10I .  This was not picked and shipped due to this issue. Suppose i am making Sales order for make to o

  • Database Configuration Assistent and JVM

    Hi Is it possible to tell Database Configuration Assistent to install JVM 1.4 instead 1.3 during creation of new database in Oracle DB 9.2

  • StringBuffer and letter color

    hi I use StringBuffer Wsb = new StringBuffer(); if (Type1.contains("on")) Wsb.append("C1"); if (Type2.contains("on")){ if(Wsb.capacity()!=0) Wsb.append(",C2"); else Wsb.append("C2"); } how can I set the color of letter C1, C2 to red, when I use Wsb.a

  • HRMS Legislation Patch

    I am looking for a HR Legislation patch (Europe) that can cover the following bank details - cannot seem to find anything: Account Number Bank Name Bank Code Currency IBAN Thanks