• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inserting image into a MS-WORD

 
rajkumar sound
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic