opening ms-word files

Can i open ms-word files in java.
Also suppose i open a file as "test.txt" or "test.doc" and input some alphabets and save it, will it become a word document??
Plz help, i want to save my files as word documents

Comments

  • : Can i open ms-word files in java.
    : Also suppose i open a file as "test.txt" or "test.doc" and input some alphabets and save it, will it become a word document??
    : Plz help, i want to save my files as word documents
    :

    To output a word document (.doc file), You'll need to know the file's specification, but I doubt that is what you want...

    You should google for a library/package (don't know it in java jargon) that can help you output word documents.

    But, if you only want to output a .txt file, then its no different from a text file...well, actually, it is a text file, the .txt is just to specify it is on Windows platforms...you can use the character-ish java.io classes like FileReader and FileWriter.

    {2}rIng
  • convert first the doc to txt:

    import officetools.OfficeFile;
    ...
    FileInputStream fis = new FileInputStream(new File("test.DOC")); // works with xls also
    FileOutputStream fos = new FileOutputStream(new File("test.TXT"));
    OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
    f.convert(fos,"pdf");

    All possible convertions:
    html --> pdf
    doc --> pdf, html, txt, rtf
    xls --> pdf, html, csv
    ppt --> pdf, swf
    from dancrintea.ro/html-to-pdf/
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories