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

Free Support Forum - aspose.com

Image created on Linux can't be read

Hello,

I used Aspose on Java to generate images from pdf or ppt or word documents and it worked fine on Windows.

When I used the same code on Linux, the images were generated but some of them couldn’t be loaded and some of them worked fine ! I don’t understand why… This happened whether the document was a pdf, ppt or word.

Thanks for your help.

I just realize that the method save on Aspose Imaging (PngImage) is the source of this problem:

    PngImage image = new PngImage(imagePath);

    if (image.getWidth() > image.getHeight()) {
        image.rotate(-90);
    }
    image.save(finalFolder + "/" + fileName);

    try {
        image.close();
    }
    catch (IOException e) {
        e.printStackTrace();
        success = false;
    }

I solved it! The thing is that the code above was called twice for some images, so they were saved twice and that’s what caused the problem.

Thanks anyway!

Hi Essaghir,

Thanks for contacting support.

We are glad to hear that your problem is resolved. Please continue using our APIs and in the event of any further query, please feel free to contact.

PS, sometimes similar issues occur when the fonts used in input PDF, PPT, Word etc file are not installed on target machine (i.e. Linux), so to resolve such issues, we need to install respective fonts over system.