TIFF to Image conversion issue in Java

@amrit007,

It is clearly a path/directory issue. In order to further investigate it at our end, we need a simple console project (using that issue could be reproduced) from you. Or you can explore our example project.

where is this “GroupDocs.Total.Java.lic” located in ur project?

[Fatal Error] :1:1: Content is not allowed in prolog.
this error keep coming

@amrit007,

In base directory (D:\GroupDocs.Conversion-for-Java\Examples\GroupDocs.Conversion.Examples.Java). For better elaboration, see this screenshot and observe the directory path - License Path.JPG (18.2 KB)

is there any chance fault in License file?

I am not having this file… mine looks like this…
Untitled.png (2.7 KB)

Untitled.png (3.1 KB)
sorry this one

so while providing this path of License file…this same coming
[Fatal Error] :1:1: Content is not allowed in prolog.

@amrit007,

Don’t you have the license file?

If you don’t have the license file, then you must not invoke the applyLicense method. It would certainly give you error.
So, by disabling the applyLicense method you can run the project and have output with limitations.
However, the good thing is you can get a temporary license here. Follow the wizard and on step 5 you can avail a temporary license. You can easily get a temporary license for GroupDocs.Conversion for Java and put it in the base directory of your project. And then instead of pointing to GroupDocs.Total.Java.lic, point to GroupDocs.Conversion.Java.lic (that you will get by following the wizard).
Please note that a temporary license is time-restricted full license that allows you to evaluate all features of the API.
Following these instructions you will get rid of that (license file not found) error.

ok i am trying to run the project without invoking License file… the error is
Exception in thread “main” java.lang.VerifyError: Bad type on operand stack

@amrit007,

It seems a environment related issue.
java.lang.VerifyError can be the result when you have compiled against a different library than you are using at runtime.
One thing more, sometimes it’s the IDE’s fault, or the device that the bytecode isn’t right. Try restarting the IDE to get it to recognize the sync issue. Failing that delete and re-install the app. Rebooting the device may also help.
Are you exploring our example project? Did you make any change in the project? If yes, then please share the changes you committed or the problematic application.
Aside this, share following details with us:

  • Your IDE
  • Java version
  • JDK and JRE version
  • Operating system
  • Complete stack trace of the exception/error

We have Java version 1.8.0_77, JDK 1.8.0_77 and JRE jre1.8.0_91.

1 Like

i came to know it was license defect and i was trying to convert over the limitation.
with jetty server using cmd conversion is happening. here are the the problems-

1-on local,Unable to get output file.(with jetty server its working as per guidance given on github)
but i want it to my local
2- Image related conversion is not happening
- image to pdf
-pdf to image
- tiff to image
all image related issue is present there

@amrit007,

We’ve prepared a simple console application for you - Examples.zip (2.7 MB). Using this you can do image to PDF and TIFF to Image conversions.
However, PDF to Image conversion has some issue that we’ve logged in our internal issue tracking system with ID:CONVERSIONJAVA-546. As we have any update on it, you shall be notified.

Can you please elaborate this scenario with more details?

1 Like

the code u have given, for multi page tiff its not working (means tiff to pdf) . after conversion black pages is coming. see the attachment(it was 4 page tiff) .tiff.tiff.pdf (359.8 KB)

@amrit007,

Can you please share the problematic multi-paged TIFF file with us?

@amrit007,

You can also convert PDF to Image without any issue. Please follow the given code:

ConversionHandler conversionHandler = new ConversionHandler(Utilities.getConfiguration());
SaveOptions saveOption = new ImageSaveOptions();
saveOption.setConvertFileType(ImageSaveOptions.ImageFileType.TIFF);
ConvertedDocument convertedDocumentPath = conversionHandler.<List<String>> convert(fileName, saveOption);
for (int i = 1; i <= convertedDocumentPath.getPageCount(); i++) {
		convertedDocumentPath.save(fileName + i + "." + convertedDocumentPath.getFileType(), i);
}

pdf to image is working but only for 1 page pdf. not multiple page pdf.

that is the issue

what i mean is, a tiff image of more than 1 pages (suppose 3 pages), when getting converted to pdf(multiple pages), the blank page is coming as i have attached the blank converted sample sample.

and I am unable to get the temporary license