Java API to fill in a MS Word file template

Ola,
Please help me on the following topic:
I need a kind of Java API which allows me to read Ms Word 2003 .doc files, replace a few strings/keywords and save the doc back.
Ideal feature would also be to allow me in the end to convert to TXT or RTF, after the strings have been replaced.
A first search on Google takes me to Apache POI, but the api looks really heavy for a beginner.
Do you have any other suggestions for another API? I do not mind if not open-source.
Thanks.

FileInputStream fis = new FileInputStream(new File("/cory/test.doc"));
FileOutputStream fos = new FileOutputStream(new File("/cory/my_result.pdf"));
officetools.OfficeFile f = new officetools.OfficeFile(fis,"localhost","8100", false);
f.replaceAll("Yahoo","Google"); // will replace all string Yahoo with string Google

Similar Messages

  • Looking for pure Java API to read metadata from an MP4 file.

    Hi, I am looking for a pure Java api that can read MP4 metadata. I have been trying to look online for one but have not found anything
    suitable. If there are no good api's, can someone point me to resources on how to parse metadata from an MP4, tutorials would be great
    as well. I have looked online for that as well but have not found much. Any help would be greatly appreciated.

    Cross posted
    http://www.java-forums.org/new-java/59652-looking-pure-java-api-read-metadata-mp4-file.html
    http://www.coderanch.com/t/580833/Streams/java/Looking-pure-Java-API-read
    http://stackoverflow.com/questions/10568588/looking-for-pure-java-api-to-read-metadata-from-an-mp4-file
    db

  • Bursting with JAVA APIs / MultiThreading / Errors Handling

    We are trying to use the bursting JAVA APIs 10.1.3.3.1 Standalone) to burst huge XML files and generate PDF Files from RTF templates. Here are a list of our issues with this feature:
    1. We have some problems catching the errors when bursting. We have tried to use the "oracle.apps.xdo.common.log.Logger" class, but it is not always reacting like we think it should. Could you please give us an exemple of a clean bursting error catching or a brief description of how we could do it. We have a lot of difficulties to find information about using the JAVA APIs of BIP.
    2. Is it a clean way of catching the bursting errors to use the "oracle.apps.xdo.common.log.Logger" class?
    3. When using the 10.1.3.3.1 DocumentProcessor JAVA API, the process gets killed when the RTF template is not where the control file specified it. Even when using a finally clause containing the document processor, we can't fetch the error from the "oracle.apps.xdo.common.log.Logger" class. We did not find a way to catch this error which make our program crash.
    4. How can we enable multi-threading that is included in the DocumentProcessor JAVA APIs so it can take advantage of the multi-processors environnements?

    1. Check tim d. blog, you can use the bursting listners to get the errors. It's also in the documentation.
    First, on every exception, the Bursting APIs are dumping the error in the Logger. So I can't see how we can use the listeners to catch these. We can check the hasExceptions on the Logger but still, we have some problems with this. When we deploy our application as a MDB (Message driven bean), it seems that once the hasException flag has been raised, if we call the MDB again, it is still up. Is there documentation about that Logger class? Also, I'm worried that we won't be able to call our MDB twice to run simultaneously 2 different bursting process since it seems the Logger is something static, keeping every exception in memory... That's bad.. And show me where you have found documentation about this. All I see in documentation is how to call the DocumentProcessor in a couple of lines. I don't see anything about a clean way to catch errors.
    2. Yes/No/Depends. I think it's fine. If your changing the logger options in your program that could come back to haunt you.
    I guess so, I'm not changing anything and its already haunting me...
    3. When using the 10.1.3.3.1 DocumentProcessor JAVA API, the process gets killed when the RTF template is not where the control file specified it. Even when using a finally clause containing the document processor, we can't fetch the error from the "oracle.apps.xdo.common.log.Logger" class. We did not find a way to catch this error which make our program crash.
    Even worst, when we deploy the component has an MDB, when the error happens, it kills the whole oc4j container... please correct this quick.
    4. How can we enable multi-threading that is included in the DocumentProcessor JAVA APIs so it can take advantage of the multi-processors environnements?
    We got an answer from the dev team which is to add two properties to the document processor, something like:
    enable-multithreading: true
    thread-count: >2
    We did that and what we got is that the process started and it got stuck in a dead lock at the first document processing. How nice! :)
    We got a milestone in March and I'm really worried about all those problems... Not enough documentation, a pretty bad error handling, errors making crash the whole oc4j container, Logger seems not to be handling simultaneous calls/ threads, not even handling two subsequent calls... etc.
    If anyone has the magic answer, it would be pretty welcomed!
    Thanks

  • How to call Java API

    Hi,
    Currently I am getting inputs from another composite, lets say Composite A and in composite B I need to pass the input values ( approx 40 elements are coming from composite A) to Java API ( end system). I have jar file for java API which has 20 different classes. Can you guys suggest me how to map the input values that are coming from composite A to Java API.
    I developed a Bpel process which receives the input from Composite A. Please suggest me for next steps and procedure to follow.
    Thanks.

    I would look into using the Spring component and wrapping your java api in a simple sprint bean class. SOA will then generate WSDL's and do marshalling/unmarshalling of the data between your BPEL and the spring component automatically. It will just look like another service call from within the BPEL but will actually invoke your spring component.
    Thanks,
    Adam DesJardin

  • JAVA API to add header and footer in MS Word

    Hi,
    please help me out, I am hanging with this concept.
    The problem is I need to add a headers in ms word file using java. I come to know that the API is support for this task is 1.apache POI 2.jacob
    I dont know which class file I need to use to do this, If anyone knows about this please let me know or send the URL's
    Thankyou,
    Baskaran.k

    ya i have used POI but i don know the class file in POI. i just now trying jacob., can u send the API and Class file to add header and footers in ms word.

  • Java API for reading/writing word/excell file

    Hello Friends,
    Is there any Java API available for Microsoft word and excell product?

    Hi,
    Start your search here
    http://jakarta.apache.org/poi

  • Splitting word document - Java API

    Hi , I would like to split a word doc in to a single document.
    ex: if i have a document with 10 pages i need to split the doc in to each one page.
    Can some one pls let me know how to do it ?? is there any Java API available ???
    Thanks in adv

    pk1234 wrote:
    Hi , I would like to split a word doc in to a single document.
    ex: if i have a document with 10 pages i need to split the doc in to each one page.
    Can some one pls let me know how to do it ?? is there any Java API available ???
    Thanks in advThis is going to be extremely difficult unless you get very lucky. I would look for new requirements or get better defined requirements.
    The problems are basically two in nature.
    1) Reading and writing Word docs sucks in general. It sucks very much for Java. Unless there is a compelling reason otherwise I would recommend using the open office plugin technique others have used rather than POI.
    2) Detecting "page" boundaries is about next to impossible in Word. Unless you are lucky enough to be able to have a document that a user has inserted page breaks into. Then maybe.
    I would in general recommend that your best approach is not to do this. Wherever the word document is being generated do what you need to do at that step.

  • Idea  about convert word document to pdf using java api

    idea about convert word document to pdf using java api if any one find it mail me at [email protected]

    api if any one find it mail me at
    [email protected]
    What happend to your other mailID :
    [email protected] ????
    http://forum.java.sun.com/thread.jspa?threadID=639851&
    messageID=3756910It received the Spam Of Death. RIP

  • How to do exact word search using Java API

    Hi,
    Can someone tell me how can I write a search query using Ultra Search Java API to return data containing a full word that is sent as a search
    parameter. e.g. If I want to search for a word 'Dictionary' I need to get all the results conatining full word Dictionary for example if I
    have following 4 records
    1. Dictionary
    2. English Dictionary
    3. French Dictionary
    4. AllDictionary
    How can I write a query that returns me first 3 records only as they contain the word 'Dictionary' and not the fourth record as it's not a word.
    Here is what I need to get back and ordered in that way as the 'Dictionary' needs to be first record because the search is on Dictionary.
    1. Dictionary
    2. English Dictionary
    3. French Dictionary
    Any help is appreciated.
    Thanks

    Looks like we can not do an exact word search using Java API.

  • Link to download java api?

    Hi,
    I've needed to download the java api a couple of times in the past, and I remember the download was impossible to find on sun's website. Once again I can't figure out where it is. Can anyone help me?
    I wonder why sun doesn't put a link to where you can download the api at the top of their web page that lets you view the api online?

    You mean, like the "Downloads" link at the top of this page?No. I looked through all the downloads, and I didn't find what I was looking for
    Downloads->Java Se->Java SE 6 Documentation
    how hard was that?Not too hard if you know that what you are after is called Java SE 6 Documentation.
    Use google next time... "Java API Download"I did--and with those exact words in a different order. It wasn't helpful.
    http://java.sun.com/javase/reference/api.jspThose are links to the online docs--not downloadable docs.
    Thanks for the help, but lose the attitude--especially for something so trivial for someone who knows their way around the sun website. Sorry for putting you all out.

  • [E2010][EWS-XML][JAVA]How to get the properties of meeting rooms in Exchange 2010 using EWS Java API

    When you look at meeting room properties in Outlook 2010, you can see 'City', 'Country/Region' and 'Department' information.
    Is there any way to get this information using EWS Java API? 

    Hi Glen,
    I am able to understand what u have said, but do not know how to implement it with meeting rooms....
    If i am implementing
    "Get all appointments between startDate and endDate in the specified folder, including recurring meeting occurrences" in ews-java-api, as you have mentioned above, i am able to get only my appointments from the start date to end date , as i
    have given my email id and password, how to get my organization meeting room details, booked or not.
    static ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
    public static void main(String[] args) throws Exception {
    // TODO Auto-generated method stub
    ExchangeCredentials credentials = new WebCredentials("[email protected]", "zzzz");
    service.setCredentials(credentials);
    try {
    System.out.println("Check");
    service.autodiscoverUrl("[email protected]",new RedirectionUrlCallback());
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    NameResolutionCollection nameResolutions = service.resolveName("SDB1",ResolveNameSearchLocation.DirectoryOnly, true);
    System.out.println("nameResolutions==="+nameResolutions.getCount());
    for(NameResolution nameResolution : nameResolutions)
    System.out.println("NAME==="+nameResolution.getContact().getDisplayName());
    The above code gives me the output like, the meeting room in my organization with word SDB1 are
    Output:
    nameResolutions===2
    NAME===SDB1- TELCON - 1
    NAME===SDB1-TELCON - 2
     for. eg. I need to know today at what are the appointments in the room SDB1-TELCON2 and who all have booked the room.
    I do not know how to implement for the meeting room can you please help me how to give it.
    Thanks in advance.

  • Numbers coming out at "1n7" instead of "1.7" when using Java APIs

    I have an RTF template, and on the Text Form Field Options dialog in Word, I have the Number Format field set to "#,##0.00000". When this template is run from a concurrent program, or from the desktop plug-in, the numbers correctly format in the form "1.7". But, when I run with template with the Java API or with the common region document viewer in OAF, the numbers are formatted in the form "1n7". I get an "n" instead of a "."
    Any ideas on what might be causing this?
    My calling code is below.
    Thanks in Advance,
    Kurz
    OADBTransactionImpl oadbTrx = ( OADBTransactionImpl ) pageContext.getApplicationModule( webBean ).getOADBTransaction();
    DataTemplate dt = new DataTemplate( oadbTrx.getAppsContext(), "XXCUS", "XX_CNQCBSR" );
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    Hashtable htp = new Hashtable();
    htp.put(
         "P_AUCTION_HEADER_ID",
         this.auctionId
    dt.setParameters( htp );
    dt.setOutput( bos );
    dt.processData();
    DocumentHelper.exportDocument(
              pageContext,
              "XX",
              "XX_CNQCBSR_MAIN",
              "en",
              "US",
              new ByteArrayInputStream( bos.toByteArray() ),
              "PDF",
              null
              );

    Perhaps check the value of profile option "ICX: Numeric characters"?

  • Is there any java API throgh which My program can get harddisk,cpu ID adres

    hello
    Is there any java api throuh which i can get hard disk and processor serial numbers.
    i have already use
    process p=Runtime.getTime().exec("cmd command");
    please other than this send any java api, progamming technique that remain same on all plate forms
    advance thanks
    best regards

    >
    Is there any java api throuh which i can get hard disk and processor serial numbers.
    i have already use ..>1) What business is that information to your app.? Or to put that another way. Why do you want to know?
    2) Those words are 'Java', 'API' and 'I' (which is always upper case).
    3) One upper case letter should be used at the start of each sentence, not just once at the start of a post.

  • Calling Java API from ABAP using JCo (Part 2)

    Hello,
    This is an additional question to thread Calling Java API from ABAP using JCo
    Has anyone managed to get the input parameter value
    input.getString("REQUTEXT")
    that is being passed from ABAP?
    If yes, what kind of setting you need to do? Because when I execute, it has no value.
    Thus, the below ECHOTEXT parameter returns blank value:
    output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
    When I debug by printing the below line, the input XML is indeed without value:
    System.out.println(input.toXML());
    Anybody knows how to pass input variable from ABAP to JAVA using JCo?
    rgs,
    hiroshi

    Hallo Hiroshi,
    as far as I can see, you are doing it the right way. The problem might be that the ABAP program does not fill in this parameter because something went wrong in the SAP System.
    Have you tried setting a breakpoint (an HTTP session - remote breakpoint) and tried checking step by step if the value is being processed and put into the REQUTEXT field?
    Bye,
    Sameer

  • Can we use Essbase JAVA API in Hyperrion Planning

    Hi,
    I want to load data and extract data from Hyperion Planning applications. can i use Essbase Java APIs to do this Or is there any separate set of APIs available for Planning Applications ?
    Thanks a lot,
    Prince

    Hi John,
    I have following doubts regarding loading data to Hyperion planning by a custom connector
    1) Loading data to Hyperion Planning application using Essbase Java API would be possible at application layer (Hyperion Planning) or at database layer (loading data directly to essbase database) ?
    2) If we load data directly to essbase database how are we going to recognize which essbase server is connected with Hyperion Planning application ? Does user require to know in advance the underlying databse server ? Is there any API in Essbase or in Planning to connect to Planning application ?
    3) If we load data directly to essbase database how to find out Planning applications and essbase application ? In other words how to differentiate between essbase applications and Hyperion Planning appllications ? Or How to recognize Planning applications ? Is there any API in Essbase to find out this ?
    4) If we read data directly from Essbase how do we recognize data from a Planning application ?
    5) What is the difference between Classic planning application and EPMA planning application ? Can we develop a connector to work with both these flavour or type ?
    Please suggest.
    Thanks,
    Prince

Maybe you are looking for

  • Error in uploading CSV (comma delimited) to database!!!!

    Hello, I'm karthik. We have a application with 10g database and we're using Ms-office 2007 in Windows XP system. While uploading csv files in Ms- office 2007 format it is good in uploading files to database. Most of our systems are upgraded to window

  • Need to pick Bill to party and Payer from Ship to party instead of Sold to

    Hi, Please let me know the configuration setting needs to be done for capturing the Bill to party and Payer from the Ship to party instead of the Sold to party. This requirement needs to apply to curtain document types only. Please respond as soon as

  • Urgent - Query on STAX

    Hi All, I started learning and working with STAX- api (Iterator) My requirement is providing the implementation to the methods like writeElement writeStartElement How can i use STAX inorder to implement the above methods. Also can anyone provide the

  • We need 3 seats for adobe creative suite cloud

    How much is three seats and ALSO we run 2 intel  imacs running 10.6 plus an older G5 running 10.4 is this an issue ? currently running CS4 on ALL of them

  • Problem after latest update on IPad?

    After my IPad completed the latest update, my phone number wasn't correct. How do I change it for I messaging and FaceTime?