I have tried to use the aspose.word to insert a TIF image into a doc file. However, it fails to do so.
Here is my code:
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.insertImage("C:\W000063.tif", RelativeHorizontalPosition.MARGIN, 0, RelativeVerticalPosition.MARGIN, 0, 450, 600, WrapType.SQUARE); doc.save("C:\HelloWorld.doc");
Here is my result after running the code:
Hello World java.lang.IllegalArgumentException: Unknown image file format. at com.aspose.words.ImageData.setImage(Unknown Source) at com.aspose.words.DocumentBuilder.insertImage(Unknown Source) at com.aspose.words.DocumentBuilder.a(Unknown Source) at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
So , how could insert a tif image into a word document?
Thank if anyone could help me.