wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes inserting image into a MS-WORD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "inserting image into a MS-WORD" Watch "inserting image into a MS-WORD" New topic
Author

inserting image into a MS-WORD

rajkumar sound
Greenhorn

Joined: Aug 29, 2008
Posts: 11
i have generated MSWORD(.doc) document from my JSP page. I want to know how i can insert an image from my desktop to that document.
thanks
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi there,

I assume you are using apache POI to create the word doc?

In that case you should be able to perform a file upload from your JSP/servlet app (there are 1000's of examples on file upload out there on the web, just search for "jsp file upload example") and insert the image using the API (I'm going to blindly assume that the API supports this).


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
I'm going to blindly assume that the API supports this.

I don't believe so. POI can extract images from a DOC file, but to my knowledge not insert images. POI's features regarding creating and changing DOC files (as opposed to reading them) are rather limited.


Ping & DNS - my free Android networking tools app
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Ulf, thanks for the clarification, I should be a little less lazy and check these things . <scurries off>, right I've actually looked at their site and API and I can see that it supports embedding png files into Excel spreadsheets but indeed doesn't appear to support inserting images into Word docs (in fact there is a TODO on their web site for better support around this area).

Disclaimer: I'm not a user of the POI libraries
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: inserting image into a MS-WORD