• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Image not dispaying in RTF document (Worddocument) using iText API

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I want to add image to document with following code.



I am using iText-rtf-2.1.0.jar APIs to insert an image to myRTF word template.
Every thing works fine in MS Word. But the content is seems to be missing when opening the same file in Word document.
The problem occurs only if I insert an image, normal texts and tables works fine in Word document.
Any idea will be greatly helpful.

Regards
Raju

 
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you saving the generated image to a file, and then reading it from the file? Why not just add the generated image directly to the RTF document?
 
Komari raj
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Angstadt wrote:Why are you saving the generated image to a file, and then reading it from the file? Why not just add the generated image directly to the RTF document?




Hi Michael,

Thank for reply..on that case also i tried....but no result..you can see code here ..




reagrds
Raju
 
Komari raj
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all Finally i got solution ..

First create image and write to some .jpeg file with follwing code..

here path is


finally add that image to word document..with follwing code.




Regards
Raju
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for sharing the solution!
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi i Can any one clear this issue Image not getting displayed when i export it to word.

I am posting my code here.



i am unable to view the barcode image.

Thanks
Siva
 
Komari raj
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

i.e the reason i posted this post..

image not inserting directly into word document ...

First you create image and write to some ".jpg or.gif " formats into file system.

finally get image from file system and write to word document.

check my previous post...

Regards
Raju
 
lshiva siva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Raju Thanks For your reply.

I was also trying it in different way but still i am not getting it. Can you confirm that the thing i am doing is correct where its going wrong



Thanks
Siva
 
Komari raj
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi siva, please understand what i am saying...

Please insert image into some file system or your application folder...after that please take that image and add to document...

i am trying to say is... directly image is not inserting into word document(this is not working) because of this reason...first save your image to file system and get back and add it to document...



Regards
Raju



 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic