[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to insert image in word using POI HWPF



Hi,      

            I am new to POI. Can any one of you give me an idea how to insert an image in word using HWPF files. I am convertion my image file in to byte stream and sending into Picture object by writeImageContent()e But after running the program my image is not copied in the desired document. Instead it is showing some garbage characters. Can any one help me in this issue. I would be pleased in any sample code is provided. The code which I had used is…

 

 

            File file = new File("D:/MyJavaPractise/WordProcessing/images/boy.jpg");

                  FileInputStream fis = new FileInputStream(file);

                  byte[] buffer = new byte[fis.available()];

                  fis.read(buffer);

 

            After this I am not knowing how to create a Picture object with this byte array..

 

 

 

Thanks in advance..

 

Pradeep.


----------------

DISCLAIMER and CONFIDENTIALITY CAUTION:

This e-mail and any attached files are confidential, proprietary, and may also be legally privileged information, and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient of this e-mail, please send it back to the person who sent it to you and delete the e-mail and any attached files and destroy any copies of it; you may call us immediately at + 91 22 6643 8000 or email us at IT-Security@tatainteractive.com

Tata Interactive Systems and/or any of its sister companies owns no responsibility for the views presented in the e-mail and any attached files unless the sender mentions so, with due authority of Tata Interactive Systems.

Unauthorized reading, reproduction, publication, use, dissemination, forwarding, printing or copying of this e-mail and its attachments is prohibited.

We have checked this message for any known viruses; however we decline any liability, in case of any damage caused by a non-detected virus.

For more details about our company, visit http://www.tatainteractive.com.

----------------


Reply to: