Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
simple-odfdom-0.8
-
None
-
Windows 7 Home 32 bit
JRE 7 32 bit
Eclipse Indigo SR2
odf-toolkit 0.5
and also tried odf-toolkit SVN revision 1395734 (built with Maven on Ubuntu): simple-odf-0.8-incubating-SNAPSHOT, odfdoom-java-0.8.9-incubating-SNAPSHOT
Description
I'm trying to create an odt file, and insert text and svg images, with limited success.
Inserting a png image is no problem, but when I change the line to insert an svg image I get an exception.
This is the minimum program to demonstrate my problem:
import java.net.URI;
import org.odftoolkit.simple.TextDocument;
public class odfgenerator {
public static void main(String[] args) throws Exception
}
If I run my program (in Eclipse) I get:
okt 08, 2012 11:30:57 EM org.odftoolkit.simple.Document newImage
SEVERE: null
java.lang.NullPointerException
at org.odftoolkit.odfdom.incubator.doc.draw.OdfDrawImage.configureInsertedImage(OdfDrawImage.java:123)
at org.odftoolkit.odfdom.incubator.doc.draw.OdfDrawImage.newImage(OdfDrawImage.java:147)
at org.odftoolkit.simple.Document.newImage(Document.java:830)
at odfgenerator.main(odfgenerator.java:12)
I delete HelloWorld.odt before every run, just to make sure. The odd thing is that despite the exception, HelloWorld.odt is still created, with the svg file inside the Pictures directory, and the content.xml has an draw:image tag with xlink:href="Pictures/simple.svg". The odt file can be opened with Apache Open Office without problem, and will display the picture.
Changing the URI to point to an png file instead results in the program terminating normally without any errors. The resulting file can also be opened with Apache Open Office without problems.
simple.svg is a very simple svg file created with Inkskape containing two boxes, and saved as "plain svg".
Am I doing anything wrong or is this a bug?