Open GoogleCodeExporter opened 8 years ago
can you pls attach screenshot(not the doc files) of both documents and the
code that you wrote?
what is your OS?
thanks
Leonardo
Original comment by leonardo...@gmail.com
on 15 Jun 2011 at 12:22
I am attaching the word file generated along with the code.
Code:
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import word.api.interfaces.IDocument;
import word.w2004.Document2004;
import word.w2004.elements.Heading2;
public class Java2Word {
public static void main (String[] args){
try{
File newDocument = new File("C:\\Java2Word.doc");
PrintWriter writer = new PrintWriter(newDocument);
IDocument iDocument = new Document2004();
iDocument.addEle(Heading2.with("===== Hello World ======").create());
String text = iDocument.getContent();
writer.println(text);
writer.close();
} catch(IOException ioException){
ioException.printStackTrace();
}
}
}
Please open this file in OpenOffice.
Regarding my OS: I am using windows XP SP2
Original comment by ankur881...@gmail.com
on 15 Jun 2011 at 11:09
Attachments:
hey mate, sorry for the late reply. This is not a new issue.
pls take a look at this issue, comment 3:
http://code.google.com/p/java2word/issues/detail?id=4&can=1&q=openoffice
Thake a look at this one as well:
http://code.google.com/p/java2word/issues/detail?id=16&can=1&q=openoffice
This guy friendly made some experiments "stein.st...@gmail.com"
thanks a lot Stein!
cheers
Leonardo
Original comment by leonardo...@gmail.com
on 20 Jun 2011 at 8:41
Thanks for the reply.
But still I am unable to solve the problem.
So can you please mention the changes in the file I had attached previously, so
that
it will open in both MS Office and Open Office.
Waiting for reply.
Regards
Original comment by ankur881...@gmail.com
on 21 Jun 2011 at 2:03
Hi Arkur881
I thought that by renaming the file to .xml would work fine in openoffice, but
didn't at all.
You said that in openoffice renders "completely different format". In my case,
in linux-libreoffice doesn't even open.
What you mean with "render"? Does it open at least? that's why I asked you to
attach screen shot of the unwanted result.
I think that all research done by stain.st(issue 4 and issue 16) was in Windows.
I chanced this to a task: "make java2word document be open in MS Word and
Open(Libre) Office in Windows and Linux"
There are some tweaks to make it open properly and we need to document this
because even I don't remember after some months.
I am going on holidays in 2 days, for a month. Depending on the work I won't be
able to do before the trip...
I need to see the screenshot as I asked ok. Thanks for your collaboration!
cheers
Leonardo Correa
Original comment by leonardo...@gmail.com
on 23 Jun 2011 at 12:14
Original comment by leonardo...@gmail.com
on 23 Jun 2011 at 12:14
I am attaching the screen shots, as you wished.
Please try to give some solution before your vacation.
Regards
Original comment by ankur881...@gmail.com
on 23 Jun 2011 at 4:03
Attachments:
yeah, it opens but doesn't render. I got the same result in Linux with Open and
Libre Office.
unfortunately I won't be able to solve research this before I go. This research
would require a lot of time: generate the file, change XML, change extension,
try different combinations, MS office on Windows, Open Office on Windows/Linux,
Libre Office in Linux/Windows.
thanks for your collaboration mate.
cheers
Leonardo
Original comment by leonardo...@gmail.com
on 23 Jun 2011 at 11:33
Hi, Does this bug got resolved? I am using java2word jar to generate word
documents. Word document looks good in Microsoft word but when I open it in
openoffice.org it shows xml tags. I am attaching converted pdf file of the word
doc opened using openoffice. Please let me know is there anything else I need
to do.
Regards,
Prachi
Original comment by prachi.a...@gmail.com
on 1 Nov 2011 at 4:36
Attachments:
not yet. There is something to be discovery and modified in the first line I
guess:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?mso-application
progid="Word.Document"?>
We need to find a way to work in both. So still yet to be resolved.
Leonardo
Original comment by leonardo...@gmail.com
on 1 Nov 2011 at 10:40
Thanks Leonardo.
Original comment by prachi.a...@gmail.com
on 2 Nov 2011 at 7:03
try to rename the file to .xml.
OpenOffice doesn't like MLWord doc renamed to .doc.
I am still trying to find a way around.
Original comment by leonardo...@gmail.com
on 2 Nov 2011 at 11:54
I renamed file to .xml but it doesn't show any data. Not even xml tags.
Thanks for looking at this. I really liked this library and document looks good
in MS Word.
Original comment by prachi.a...@gmail.com
on 4 Nov 2011 at 9:43
thanks for you feedback mate. I am trying to find a way to work in MSWord and
OppenOffice but I haven't found out yet. This is the main thing I will try to
get done soon.
Leonardo
Original comment by leonardo...@gmail.com
on 4 Nov 2011 at 11:35
I found that renaming the file to .docx works for me
Original comment by gpbo...@gmail.com
on 18 Jan 2012 at 1:20
Original issue reported on code.google.com by
ankur881...@gmail.com
on 14 Jun 2011 at 12:15