TIFF to pdf conversion issue in Java

I am using GroupDocs conversion trail version (17.3.0) as part of POC and trying to convert some files.

facing below 2 issues.


java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:779) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
at com.target.eci.groupdocs.conversion.Application.main(Application.java:13) [main/:na]
Caused by: com.aspose.ms.System.ab: TiffImageException: Failed to decode the image strip 0. Details: Cannot read 25235234 bytes from stream.
at com.aspose.ms.core.System.Drawing.imagecodecs.core.ff.tiff.codecs.readers.TiffUncompressedReader$a.process(Unknown Source) ~[groupdocs-conversion-17.3.0.jar:1.0_01]

java.lang.OutOfMemoryError: Java heap space
at com.groupdocs.conversion.internal.c.a.i.ak.a(Unknown Source) ~[groupdocs-conversion-17.3.0.jar:1.0_01]

@Gangireddy1505,

Thanks for sharing the exception details. You are required to share problematic files (source files you tried to convert) and sample project as well. So that we can investigate this issue and help you out ASAP.

public void run(String… args) throws Exception {

Utilities listFilesUtil = new Utilities();
final String tiffdirectory = "./Data/tiffs";

File directory = new File(tiffdirectory);
//get all the files from a directory
File[] fList = directory.listFiles();
for (File file : fList) {
    if (file.isFile()) {
        System.out.println(file.getName());
        Conversion.convertToPdfAsFilePath(file.getName());
    }
}

}

public static void convertToPdfAsFilePath(String fileName) {
//ExStart:convertToPdfAsFilePath
// Instantiating the conversion handler

    ConversionHandler conversionHandler = new ConversionHandler(Utilities.getConfiguration());
    PdfSaveOptions saveOption = new PdfSaveOptions();
    saveOption.setOutputType(OutputType.String);

    // Set absolute path to file
    String guid = fileName;
    String convertedDocumentPath = conversionHandler.<String> convert(guid, saveOption);
    //System.out.print("Converted file path is: " + convertedDocumentPath);
//ExEnd:convertToPdfAsFilePath

}

build.gradle dependencies
dependencies {
testCompile group: ‘junit’, name: ‘junit’, version: ‘4.12’
compile ‘com.groupdocs:groupdocs-conversion:17.3.0’
compile(‘org.springframework.boot:spring-boot-starter’)
}

@Gangireddy1505,

Can you please share all of the problematic files that are in your tiffs folder? We’ll further investigate the issue using those files.

It seems there are number of large files you are trying to convert. Once you share all those problematic files, we shall investigate the issue and share a workaround with you.

I am not suing not trying to convert large file. Its small file around 34 KB tif file. I am not sure how attach a file here.

@Gangireddy1505,

Please follow the instructions given in the screenshot in order to upload a file.
How to attach a file.PNG (10.4 KB)

test.zip (610.2 KB)

Hi Athir,

I have attached 3 tif files I am trying to test with.

The problem was I am not able to see icons in IE browser while replying to topic. Chrome is working.

Thanks
Lakshmi.

this is the error i am getting
Caused by: com.aspose.ms.System.ab: TiffImageException: Failed to decode the image strip 0. Details: Cannot read 32154854 bytes from stream.

@Gangireddy1505,

Thanks for sharing the problematic files. We are investigating your issue and we’ll let you know about the outcomes. Your patience will be appreciated.

Hi I do not have access to https://forum.groupdocs.com/t/groupdocs-annotation-product-family-for-java/5062

Even though I created account, I do not have access to above forum topic.

Thanks
Lakshmi.

@Gangireddy1505,

Kindly omit the email notification you got from forum about this query. You got this notification by mistake.

do you have any info for me on this topic.

Thanks
Lakshmi.

@Gangireddy1505,

We haven’t heard a response back (on this issue) from the concerned team yet. Your logged issue ID is CONVERSIONJAVA-425. However, we’ve asked them ETA for the fix. As we get any update from them, you’ll be notified

@Gangireddy1505,

We are please to inform you that your reported issue is resolved in 17.7 version of the API. You can download this version of the API here. If you face any further issue, share that with us.