thuliobuarque / java2word

Automatically exported from code.google.com/p/java2word
0 stars 0 forks source link

Image.from_FULL_LOCAL_PATHL() produces broken image #51

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What web framework and version are you using (Struts1, Struts2, Spring,
JBoss Seam)?
None

Did you download j2w-ejb-2.0.zip or built from the source code?
Download

Which web server did you deploy your .WAR (Tomcat, JBoss)?
Tomcat

Are you using Maven or Ant?
No

What is your Operational System?
Windows 7

What steps will reproduce the problem?
1. Add an image using Image.from_FULL_LOCAL_PATHL(), like so:
myDoc.addEle(Image.from_FULL_LOCAL_PATHL(imageFile().getPath()));
2. In the resulting Doc file I can see the image box, but it shows as a broken 
link, even though the file exists locally.
See attached files.

Please provide any additional information below.
It's a PNG file. I had to include xstream-1.3.1.jar in my classpath because it 
was throwing an exception otherwise.
I've also tried with new Image(path, ImageLocation.FULL_LOCAL_PATH)
but with the same results.

Original issue reported on code.google.com by try6...@gmail.com on 4 Jul 2011 at 12:50

Attachments:

GoogleCodeExporter commented 8 years ago
Hi try6

I got your xml attached, pasted in http://xmlindent.com/ and as you can see, 
the path is a bit weird: 

                  <w:p wsp:rsidR="008979E8" wsp:rsidRDefault="0056522B">
                        <w:r>
                              <w:pict>
                                    <v:shape id="_x0000_i1026" type="#_x0000_t75" style="width:254.25pt;height:273.75pt">
                                          <v:imagedata src="../../../Program%20Files/eclipse-jee-helios-SR2-win32-x86_64/eclipse/files/input/giladd/1.png"/>
                                    </v:shape>
                              </w:pict>
                        </w:r>
                  </w:p>

I recommend you to print out the value of imageFile().getPath() ,before the 
line:

myDoc.addEle(Image.from_FULL_LOCAL_PATHL(imageFile().getPath()));

See if the path is correct and absolute (without ../../)

cheers
Leonardo Correa

Original comment by leonardo...@gmail.com on 25 Jul 2011 at 5:22

GoogleCodeExporter commented 8 years ago

Original comment by leonardo...@gmail.com on 6 Aug 2011 at 12:51