Bug 31498 - Word file created by HWPFDocument.write(FileOutputStream) has no content
Summary: Word file created by HWPFDocument.write(FileOutputStream) has no content
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 2.0-dev
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-30 19:06 UTC by Mark Thurston
Modified: 2013-07-01 09:36 UTC (History)
0 users



Attachments
The Doc file created by POI (13.50 KB, application/msword)
2004-09-30 19:09 UTC, Mark Thurston
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Thurston 2004-09-30 19:06:15 UTC
I tried the following code:

try {

	HWPFDocument doc = new HWPFDocument(new FileInputStream 
("c:\\test.doc")); 
	Range r = doc.getRange(); 
	 
	r.insertAfter( "this is the text that I wanna insert "); 
	OutputStream out = new FileOutputStream("c:\\test1.doc"); 
	doc.write(out); 
	 
	out.flush(); 
	out.close(); 
}
catch (Exception ex) {
	ex.printStackTrace();
}

And then tried to open the Word file using Word from Office 2003 and there was 
no content.  So I then opened the file in a hex editor and noticed that the 
text was in the file, but it was not showing up in Word.
Comment 1 Mark Thurston 2004-09-30 19:09:37 UTC
Created attachment 12913 [details]
The Doc file created by POI
Comment 2 Dominik Stadler 2013-07-01 09:36:03 UTC
Could not reproduce this any more with latest 3.10-beta1, seems to have been fixed a long time ago, please reopen if this is still a problem for you.