Bug 42418 - Office document with embedded object are corrupted by POI
Summary: Office document with embedded object are corrupted by POI
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POIFS (show other bugs)
Version: 3.0-dev
Hardware: PC Windows 2000
: P2 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-15 01:17 UTC by math512
Modified: 2011-07-18 09:08 UTC (History)
0 users



Attachments
Sample file (26.74 KB, application/octet-stream)
2007-05-15 01:18 UTC, math512
Details

Note You need to log in before you can comment on or make changes to this bug.
Description math512 2007-05-15 01:17:11 UTC
Office document that contain embedded object are not correctly write by POIFS.
After writing document, I try to read it with POIBrowser. I have the following
exception:

D:\word-001-updated.doc: java.io.IOException: block[ 0 ] already removed

Source:
	public static void main(String[] args) throws IOException {
		String path = "D:\word-001.doc";
		String path2 = "D:\word-001-updated.doc";
		String[] paths = {path, path2};
		
		POIFSFileSystem.main(paths);
		POIBrowser.main(paths);
	}

I have try with Excel files, and i have the same problem.

Thanks.
Comment 1 math512 2007-05-15 01:18:16 UTC
Created attachment 20200 [details]
Sample file
Comment 2 Yegor Kozlov 2008-04-16 05:10:29 UTC
Fixed in POI 3.0.3

Yegor
Comment 3 milind 2011-07-18 09:05:54 UTC
(In reply to comment #0)
> Office document that contain embedded object are not correctly write by POIFS.
> After writing document, I try to read it with POIBrowser. I have the following
> exception:
> D:\word-001-updated.doc: java.io.IOException: block[ 0 ] already removed
> Source:
> 	public static void main(String[] args) throws IOException {
> 		String path = "D:\word-001.doc";
> 		String path2 = "D:\word-001-updated.doc";
> 		String[] paths = {path, path2};
> 		
> 		POIFSFileSystem.main(paths);
> 		POIBrowser.main(paths);
> 	}
> I have try with Excel files, and i have the same problem.
> Thanks.



Hi ,

Is that possible to add a embedded object(like pdf file) in  word generated file by using Java ?

Actuaallly I want a pdf file as a embedded object ,want to show pdf file as icon into Word file and after clicking on that pdf icon ,then that will open that pdf file .

I am sending a word file including a object .

Is that possible to create the same by using java?

please send me the code on my mail id milindcp_01@rediffmail.com .

Thanks
Comment 4 Nick Burch 2011-07-18 09:08:35 UTC
Please do not ask usage questions in old bug reports!