Hello Jason,
I am new to docX4j. I am able to add an .jpeg image file to word document however, when I add .svg file it throws following error:
imconvert: Must specify image size `D:/TEMP/magick-itjvr8TN' @ mvg.c/ReadMVGImage/184.
imconvert: missing an image filename `png:-' @ convert.c/ConvertImageCommand/2838.
Exception in thread "main" org.docx4j.openpackaging.exceptions.Docx4JException: Error checking image format
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage.ensureFormatIsSupported(BinaryPartAbstractImage.java:297)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage.createImagePart(BinaryPartAbstractImage.java:184)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage.createImagePart(BinaryPartAbstractImage.java:151)
at com.apcc.reports.docx4j.AddImage.newImage(AddImage.java:109)
at com.apcc.reports.docx4j.AddImage.main(AddImage.java:75)
Caused by: java.io.EOFException
at javax.imageio.stream.ImageInputStreamImpl.readInt(Unknown Source)
at javax.imageio.stream.ImageInputStreamImpl.readUnsignedInt(Unknown Source)
at org.apache.xmlgraphics.image.loader.impl.PreloaderEPS.preloadImage(PreloaderEPS.java:65)
at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:165)
at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:96)
at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:112)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage.getImageInfo(BinaryPartAbstractImage.java:558)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage.ensureFormatIsSupported(BinaryPartAbstractImage.java:289)
... 4 more
Also, I am not finding any API [methods] or samples to create TOC in the word file. Can you please help?
Regards,
Sharad