Convert TIFF Image to PDF using Java | Install Native JAI & ImageIO on Windows & Linux | Image Reader

What is the best image reader for TIF/TIFF suitable for windows and Linux?

@tony889,

Aspose.Imaging API is capable of working with Tiff images. It comes both for .NET and Java based platforms and can be used both in Windows as well as Linux. Please visit this documentation link for your convenience and share with us if you still feel any issue.

Thanks @mudassir.fayyaz for your response of my issue.

I’m actually implementing TIFF to PDF conversion. Here I got the blocker. It is on line 73 of below snippet code. It looks like my machine has no image readers for TIFF. Would you mind to advise me what should I do?

image.png (13.1 KB)

@tony889,

In the attached image, you are using ImageIO for your working with Tiff file. I may assist and help you with issues or requirements related to Aspose related APIs. Can you please consider using example shared over following thread using Aspose APIs.

Thanks @mudassir.fayyaz for providing me a solution.

Currently I only have a license for Aspose.words. Looks like your solution requires us to need to get licenses for Aspose.Imaging and Aspose.PDF. Is that so? Any other solution you might think of?

@tony889,

Yes, In order to fulfill the requirements, you need to have license for both APIs. The other option is to use only Aspose.Imaging and suggest you to please visit this documentation link.

The other option that you may consider with having your license is to import a Tiff file in a Word document and then export Word file to PDF. I am moving this thread to concerned forum, where our team will assist you further w.r.t possible options using Aspose.Words.

@tony889,

You can convert Image files such as JPEG, TIFF, PNG etc to PDF by using Aspose.Words for Java API alone. Please also refer to the ‘Additional Dependencies’ section of System Requirements page. For example:

Dear @awais.hafeez, I have implemented as you suggested. But I can only generate a blank pdf pages. Have you ever encountered this kind of problem?

@tony889,

Please ZIP and upload your input Image file (you are getting this problem with) and Aspose.Words generated PDF file showing the undesired behavior here for testing. We will then investigate the issue on our end and provide you more information.

@awais.hafeez

Sorry for slow response. Thank you so much for your willingness to help me solving this issue. Here I send you the files.TestUploadTIFF.zip (152.6 KB)

@tony889,

The PDF you shared was actually produced by using a very old version (10.5) of Aspose.Words for Java.

And after an initial test with the latest (20.6) version of Aspose.Words for Java, we were unable to reproduce this issue on our end. Please see the output PDF document that we generated on our end by using the Java code from this (Convert an Image to PDF) article:

So, we suggest you to please upgrade to the latest version. Hope, this helps.

@awais.hafeez

Thank you so much. Do I have to purchase a new license for 20.5?

@tony889,

The 20.6 version of Aspose.Words for Java was released on 14th June, 2020.

Please open your existing license (.lic) file with Notepad (but do not edit or re-save it) and check the subscription expiry date. If your license expiry date is greater than 14 June, 2020 (release date of 20.6 version) then you can use Aspose.Words for Java 20.6. if not, then yes you will have to purchase a new license to be able to use latest version of Aspose.Words for Java.

For renewing/upgrading a license subscription, please contact our sales team:

@awais.hafeez

Unfortunately we don’t have license files that expire longer than 14th June, 2020. However, we have another license file which expired on Feb 27, 2019. It should cover version 19.2. The question is can we apply the same code for version 19.2?

@tony889,

Yes, the 19.2 version should work fine with that license.

You can try Aspose.Words for Java 19.2 to see if it produces the desired output on your end or not? But, if you want to test Aspose.Words 20.6 without the evaluation version limitations, then you can also request a 30-day Temporary License. Please refer to How to get a Temporary License?

P.S: Please note that we do not provide support for older released versions of Aspose.Words. We also do not provide any fixes or patches for old versions of Aspose APIs. All fixes and new features are always added into new versions of our APIs.

@awais.hafeez
Thanks for your advise. I encountered some problems while using Aspose.Words version 20.6. I got this error. Do you have any idea what was happened? I have installed JAI and JAI Image on my x86 JDK.

23:12:01,424 SEVERE [Sonora] (http-/192.168.153.159:8080-1) Exception thrown on server AIA-IND!52766.
javax.imageio.spi.ImageOutputStreamSpi: Provider com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi not found


javax.imageio.spi.ImageOutputStreamSpi: Provider com.sun.media.imageioimpl.stream.ChannelImageOutputStreamSpi not found
at java.util.ServiceLoader.fail(ServiceLoader.java:231)
at java.util.ServiceLoader.access$300(ServiceLoader.java:181)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:365)
at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:210)
at javax.imageio.spi.IIORegistry.(IIORegistry.java:138)
at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:159)
at javax.imageio.ImageIO.(ImageIO.java:65)
at com.eistream.sonora.grammar.extended.OpConvertImageToPDF.evaluate(OpConvertImageToPDF.java:69)
at com.eistream.utilities.expression.op.OpVoid.evaluateAsVoid(OpVoid.java:134)
at com.eistream.utilities.expression.opscript.OpCodeBlock.evaluate(OpCodeBlock.java:56)
at com.eistream.utilities.expression.op.OpVoid.evaluateAsVoid(OpVoid.java:134)
at com.eistream.utilities.expression.opscript.OpScript.evaluate(OpScript.java:26)
at com.eistream.utilities.expression.op.OpBoolean.evaluateAsVoid(OpBoolean.java:145)
at com.eistream.utilities.expression.ExpressionScript.evaluateIt(ExpressionScript.java:1103)
at com.eistream.utilities.expression.ExpressionScript.getValue(ExpressionScript.java:1030)
at com.eistream.sonora.system.SystemSessionEJBBean.doAjaxCall(SystemSessionEJBBean.java:2639)
… 64 omitted
at com.eistream.sonora.ajax.AjaxServlet.doGetOrPost(AjaxServlet.java:248)
at com.eistream.sonora.ajax.AjaxServlet.doGet(AjaxServlet.java:100)
… 16 omitted

@tony889,

After a quick search on Google, it does not seem to be an issue in Aspose.Words for Java API. But, please ZIP and attach the following resources here for testing:

  • Your simplified input Word document (if any)
  • Image file you are getting this problem with
  • Please also create a standalone simple Java application (source code without compilation errors) that helps us to reproduce this problem on our end and attach it here for testing. Please do not include Aspose.Words JAR files in it to reduce the file size.
  • Please also list the complete steps that we can perform on our end to reproduce this exception.
  • Environment details e.g. Java (JDK) and OS versions

We will then start investigation into this problem and provide you more information.