We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

[SOLVED] Insert a 'TIFF' picture

Hi,

I would like to insert a ‘TIFF’ picture but nothing happens. (I get a FileNotFoundException if I have a break point in this exception).
Here is my code :

Document doc = new Document(); 
DocumentBuilder builder = new DocumentBuilder(doc); 
builder.insertImage("d:\\myPicture.tiff");
doc.save("D:\\AsposeOut.docx", SaveFormat.DOCX);

Sorry, I can not attach a ‘tiff’ file.

Thanks in advance.

Hi Roseline,

While using the latest version of Aspose.Words for java i.e. 11.4.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system as WORDSNET-6473. Your request has also been linked to this issue and you will be notified as soon as it is resolved.

Sorry for the inconvenience.

Best Regards,

Hi Tital,

I notice that the bug is for Word .Net.
But I develop in Java.
Is it possible to have a ticket in Java too ?

Regards.

Hi Roseline,

Thanks for highlighting the matter. We have already logged this issue for JAVA in our bug tracking system and its new tracking number is WORDSJAVA-599. Now your request has also been linked to the new number and you will be notified via the forum as soon as it is resolved.

Please feel free to contact us for any further assistance…

Best Regards

,

Hi,

Just for information, I have download the version Java 11.5. and now I have a IllegalStateException for the insertion of a TIFF picture.

Regards.

Hi Roseline,

Thanks for your inquiry.

Please note that the latest version of Aspose.Words for Java is completely auto-ported from .NET, i.e. we do not write code for Aspose.Words for Java; it is generated out automatically from C# code of Aspose.Words for .NET. In your case, the issue, that was previously logged with WORDSNET prefix, would be auto resolved for Java variant of Aspose.Words as well. Your problem will now be fixed as soon as the linked issue is resolved.

Roseline:

I have a IllegalStateException for the insertion of a TIFF picture.

Could you please attach your TIFF file here for testing? I will investigate the issue on my side and provide you more information.

Best Regards,

Hi,

Please find in attachment a .tiff picture (rename the .png into .tiff extension)

Regards.

Hi Roseline,

Thanks for your inquiry.

I have verified the status of related issue from our issue tracking system and regret to share that this issue is still unresolved. Currently it is pending for analysis and is in the queue. However, we will inform you via this forum thread as soon as it’s resolved.

Sorry for the inconvenience faced.

Best Regards,

Hi Roseline,

Thank you for sharing “saintseiya.png” with us.

While using the latest version of Aspose.Words for JAVA i.e. 11.5.0, I managed to reproduce “java.lang.IllegalStateException” on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSJAVA-585. Your request has been linked to this issue and you will be notified as soon as it is resolved.

Sorry for the inconvenience.

Best Regards,

Hi

I downloaded Aspose.Words for Java 11.5, and It works fine.

The problem is Aspose.Words for Java can’t handle TIFF files without JAI library
https://docs.aspose.com/words/java/system-requirements/

Please add JAI in the classpath and try it again.

The issues you have found earlier (filed as WORDSJAVA-559) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,

Thank you for your reply.
I have download the Aspose for JAva 11.7 and the JAI jar file, but i still have the ‘IllegalStateException’.

java.lang.IllegalStateException: Unknown metafile type.
at asposewobfuscated.OE.Ã(Unknown Source)
at asposewobfuscated.N0.V(Unknown Source)
at asposewobfuscated.N0.(Unknown Source)
at com.aspose.words.JA.N(Unknown Source)
at com.aspose.words.JA.setImageBytes(Unknown Source)
at com.aspose.words.ImageData.setImageBytes(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.DocumentBuilder.Ã(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)

I may make something wrong.

Here my code :

Shape shape = builder.insertImage(new File(url).getAbsolutePath());

Thanks in advance.

Hi Roseline,

Thanks for the additional information. This problem occurs because Java Advanced Imaging library for JDK is not installed on your side. Could you please double check if JAI is configured on your side? You can check for a respective entry in the installed programs list in the control panel.

Best Regards,

Hi, thanks for your reply.

I use a Eclipse project and I have added the jar “jai_windows-i586.jar” in my project.

I may do something wrong.

Please find the configuration screenshot in attachment.

Regards.

I’m sorry.

I didn’t downloaded the good library.
It works now !

Thanks for your answer and your support.

Regards.

Hi
Roseline,

Thanks for the additional information. It is perfect that you managed to resolve the problem on your side. Please let us know any time you have any further queries.

Best Regards,

The issues you have found earlier (filed as WORDSJAVA-585) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Im still having this problem. I have the latest aspose.words libraries and the latest JAI. Can I get better instructions on how to correct this issue?

Hi Kevin,

Thanks for your inquiry. Please download/install the JAI reader from here and add the JAI library to your project to be able to process images.

Best regards,