How to read Word Document in JAVA

I use POI for read an write Word Document, but i have a problem of a compatibility (i use Word 2003 & the api poi supportes Word97).
Can you help me please !!!

Aspose.words is an interesting product with a good compatibility (up to word 2003).
It is pure Java (Word is not required) but it's a commercial product. The only thing missing is the ability to print a word document.
http://www.aspose.com/Products/Aspose.Words/Default.aspx
Bye.

Similar Messages

  • How to read word document in pl/sql

    How to read word document which is stored as BLOB column in table.
    I want to read it word by word.Please explain me how to raed using DBMS_lob
    package and substr,instr.

    You cannot. A Microsoft Word document is in a proprietary binary format. You cannot treat it as a text file and read "word-by-word" from it.
    As for examples - refer to the [url http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/toc.htm]Oracle® Database PL/SQL Packages and Types Reference manual. It describes DBMS_LOB and its usage in detail.

  • HOW TO OPEN WORD DOCUMENT FROM JAVA???

    hi everyone! Can you please help me to come with this problem? Let me to set my main target I want to achieve:
    1) In my program user should first press a button;
    2) Then already created Word Document should be opened (I DO NOT NEED to open that Word Document in Java or something like JField). Just simply it should be opened as a Microsoft Word Document.
    I DO NEED YOUR HELP! PLEASE HELP ME....!

    Running cmd using the exec is also a windows only solution, there is no "more" or "less" it that solution compared to the rundll.
    Since word is a windows format its pretty obvious that the application is ran under windows platform.
    If you are running on a different platform (maybe using open office you can open word documents, i'm not sure) you might want to use the JDIC library (https://jdic.dev.java.net/) which enables you to open/edit/browse such files using the default viewer/editor/browser of the system you are working on.
    Look at the org.jdesktop.jdic.desktop.Desktop object for these methods.
    You can also find the Desktop object in J2SE6 but its still in beta.

  • How to open Word Document using java?

    Respected Sir/ Madam,
    I am doing my project in Network Security using java. I have to transfer the files from server to the client. Each transferred file should have some of the access privileges such as read, write and exeucte. If the transferred file is a word document means then automatically the client should open Microsoft word and if the file is having Read Permission alone then the save, Save As, cut,copy, paste options in the MS - Word should be disabled. This is similar for all the files that i have transferred. That is if the transferred file is excel, audio, video,txt file the corresponding application should be opened properly. How could I acheive this. If the file is having write permission then if the user clicks the save option then the contents of the file should be saved in the server machine not in the client machine, Could we achieve this???? Can anyone help me regarding this? Please give me your views about this query?

    Respected Sir / Madam,
    Thank you very much for your reply. Could we use Microsoft API inside java program to achieve my doubts?? Could U explain it more????

  • How to read word files using java

    Reding text files is prity simple. But when i tried to read msword file I could do it.
    Can any one discuss how to do it
    Thanks

    Sorry this is not a reply but in fact i need the solution for that as i am in an urgency of that can you post that to to me if u have got it, I need it for my project

  • Reading Microsoft Word Document in JAVA

    Hi friends,
    im using follwing code to read word document in java using apache poi package..
    import org.apache.poi.poifs.filesystem.*;
    import org.apache.poi.hwpf.*;
    import org.apache.poi.hwpf.extractor.*;
    import java.io.*;
    public class readDoc
    public static void main( String[] args )
    String filesname = "Hello.doc";
    POIFSFileSystem fs = null;
    try
    fs = new POIFSFileSystem(new FileInputStream(filesname;
    //Couldn't close the braces at the end as my site did not allow it to close
    HWPFDocument doc = new HWPFDocument(fs);
    WordExtractor we = new WordExtractor(doc);
    String[] paragraphs = we.getParagraphText();
    System.out.println( "Word Document has " + paragraphs.length + " paragraphs" );
    for( int i=0; i<paragraphs .length; i++ ) {
    paragraphs[i] = paragraphs.replaceAll("\\cM?\r?\n","");
    System.out.println( "Length:"+paragraphs[ i ].length());
    catch(Exception e) {
    e.printStackTrace();
    but im getting exception that
    java.io.IOException: Unable to read entire header; -1 bytes read; expected 512 bytes
    at org.apache.poi.poifs.storage.HeaderBlockReader.<in it>(HeaderBlockReader.java:78)
    at org.apache.poi.poifs.filesystem.POIFSFileSystem.<i nit>(POIFSFileSystem.java:83)
    how to solve this issue.. please suggest me .. its urgent..
    Add to satheeshtech's Reputation

    You might do better consulting [http://www.nabble.com/Apache-POI-f298.html|http://www.nabble.com/Apache-POI-f298.html] .

  • How to upload word documents in iphone?

    Hello, I need to give a talk and I dont have printer... I should use the iphone, but I dont know how to read Word documents in the iphone... Someone can help me?

    Apple has a paid  app called Pages.  I have never used it but I guess it will open Word documents and might even allow you to store them on your phone maybe in ibooks or somewhere

  • Api POI read and replace my word document with java

    Hi
    Everyone
    I�d like to know if someone has a piece of code reading a word document with api POI to send me?
    I need read replace the word document wiht java j2ee.
    Thanks

    Hello,
    You have to use the Office Integration Library. Please, follow the documentation below:
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/32853febec3c17e10000000a114084/frameset.htm
    I hope this helps you.
    Regards,
    Blanca

  • How To Create MS-Word Document in JAVA ?

    I want to create a MS-Word Document using JAVA.
    then i want to create table in that document.
    is there any way through which i can create a Object of MS-Word in JAVA.

    As far as I know. There is no support. And you can't get the file format specification for MS Word documents.
    My advice is to look in to RTF, the spec is out there, although its not very nice.
    I think you can do tables in RTF, and you just need to write your output as text and MS word will load it.
    One thing to do is create a table in Word and save it as RTF, then look at the text and try to see whats going on. Although it won't be pretty !! Good luck

  • Create Word document with Java

    I want to create a Word Document with Java. But I don't know how can I insert text in a Word document.

    I searched and found JXWord (probably limited to Windows): http://www.geocities.com/picmapicma/
    I'm interrested to know if it works fine...:)

  • Flagging Word documents with Java???

    Hi everyone!
    We are currently designing an Intranet architecture in J2EE and are looking for a solution to the following problem:
    We are going to create a Word template which all users submitting a document must use in order for this to be accepted. The reasoning behind this is that we are using a pubishing package to convert all documents into HTML and we need to ensure consistent formatting. The problem is how do we ensure that this template is used? What we want to do is somehow 'flag' the original template and allow the framework to check whether the document submitted is flagged (i.e. used the original template). So i guess the question i'm asking here is does anyone know how we might go about this? Is Java able to read Word documents in their native format?
    Many thanks for your help in advance

    Seems to me that regardless of whether they started with the template or not, they are free to completely change the contents so that it wouldn't resemble the template in the end. So even if you could determine that, it doesn't seem worth anything.

  • Generating reports in .doc format (Word Document) using Java POI - HWPF

    Hi
    Can anybody help me how to generate the report in .doc format using POI API?
    Please share the sample code, if you have.
    Thanks in Advance
    Dhilip

    Hi,
    I dont think that your requirement has to do with ADF capabilities.
    You want to edit a word document with JAVA. For that reason, you will need an API, as the suggestions above.
    You can do it without ADF and by using standard JAVA and the API of your choice. a static void main will do for that matter.
    ADF comes into the game when you want to handle the document with your ADF application.
    This means that you either want to get your new data to be placed on your doc from BC or any other DataControl or you want to do something else with ADF..
    My guess is that you want to get data from ADF into your Doc.
    You could create an API on handling your Doc and then use it into your ADF application.
    Regards,
    Dimitris.

  • How To Read RTF file in JAVA?  Using  iText?

    How To Read RTF file in JAVA?  Using  iText?.....
    import java.io.*;
    import com.lowagie.text.*;
    import com.lowagie.text.rtf.*;
    public class RTF3 {
    public static void main(String[] args) {
    // System.out.println("This example generate a RTF file name Sample.rtf");
    // Create Document object
    Document myDoc = new Document();
    try {
    // Create writer to listen document object
    // and directs RTF Stream to the file Sample.rtf
    RtfWriter2.getInstance(myDoc, new FileOutputStream("Sample.rtf"));
    // open the document object
    myDoc.open();
    // Create a paragraph
         Paragraph p = new Paragraph();
         p.add("Helloworld in Rtf file..amazing isn't");
         // Add the paragraph to document object
    myDoc.add(p);
    catch(Exception e) {
    System.out.println(e);
    //close the document
    myDoc.close();
    Exception in thread "main" java.lang.NoSuchMethodError: com.lowagie.text.Rectangle.width()F
         at com.lowagie.text.rtf.document.RtfPageSetting.rectEquals(RtfPageSetting.java:433)
         at com.lowagie.text.rtf.document.RtfPageSetting.guessFormat(RtfPageSetting.java:362)
         at com.lowagie.text.rtf.document.RtfPageSetting.setPageSize(RtfPageSetting.java:341)
         at com.lowagie.text.rtf.RtfWriter2.setPageSize(RtfWriter2.java:248)
         at com.lowagie.text.Document.open(Unknown Source)
         at view.RTF3.main(RTF3.java:23)
    CAN you HELP me?

    import com.lowagie.text.Document;
    import com.lowagie.text.rtf.parser.RtfParser;
    import java.io.FileInputStream;
    String inputFile = "sample.rtf";
    Document document = new Document();
    document.open();
    RtfParser parser = new RtfParser(null);
    parser.convertRtfDocument(new FileInputStream(inputFile), document);

  • Writing to word document using java

    hi,
    i want to retrieve the values from database and then write to .doc file. how can i write to a word document using java?
    thanks in advance

    Google for "java write to word file"
    and behold the magic results

  • How to Read Attached Document In oracle apps.

    Hi All,
    how to read attached document in Oracle apps.
    Select * from   fnd_attached_documents.
    Regards,
    Mohan Reddy

    Hi Husseein,
    how to read pdf file in blob data type column
    i have tried below query but in this part utl_file.fopen asking directory name i don't have directory name.
    could you give any another solution.
    DECLARE
      l_file      UTL_FILE.FILE_TYPE;
      l_buffer    RAW(32767);
      l_amount    BINARY_INTEGER := 32767;
      l_pos       NUMBER := 1;
      l_blob      BLOB;
      l_blob_len  NUMBER;
    BEGIN
      SELECT FILE_DATA
        INTO   l_blob
        FROM   fnd_lobs
         where file_name = 'est-1.pdf' and FILE_ID = 332810;
      l_blob_len := DBMS_LOB.getlength(l_blob);
      -- Open the destination file.
      l_file := UTL_FILE.fopen('IRB','STD_FlipBook_Religion2013.doc','wb',18306);  --(Here I don't have Directory name)
      DBMS_LOB.read(l_blob, l_amount, l_pos, l_buffer);
      UTL_FILE.put_raw(l_file, l_buffer, TRUE);
      l_pos := l_pos + l_amount;
      -- Close the file.
      UTL_FILE.fclose(l_file);
    END;
    Regards,
    Mohan Reddy

Maybe you are looking for

  • How to tally  Aging balance

    Hi, I am running aging T-code S_ALR_87012178 as on 10/31/2007 for a Recon Account and getting balance of 100000. Now how should I tally that this balance is correct. If I run FBL3N and FS10N I get balance of 125000. So I cannot tally because the agin

  • Implicit-Null Label Value

    Hi, A quick question. Does anyone know if when said that last hop router signals implicit null to penultimate router it actually sends the advertisement (LDP for example) with a label value of 3 or is there another way to signal that? If so, I assume

  • How to add a CSV file to a desktop application and access it?

    I'm writing a desktop application for looking up phone numbers (this numbers are stored in a .CSV file). Where should I put the file in the project and how to access it? I intend to put it in the project and open it in a buffered reader! Thanks!

  • All buttons in Firefox have dissappeared after a PC optimization software- please help!

    I am using Windows 7 on a Toshiba laptop. I used AVG's PC clean-up as a trial (no longer have access to it). During the process, I chose to turn off blinking and revolving content on Firefox (thinking I was turning off those annoying ads). Now, all o

  • Help - Problem with word documents

    Hi All of a sudden I am having problems with documents in my word application.  Files I have previously transderred on to my Mac from a memory stick or via email attachments are unable to be altered.  i cannot add to a downloaded document that needs