Locally on Windows there is no problem but with Deployment on linux (dokku).
Libreoffice is installed. The template format is xlsx with inlining images.
The images are loaded to band as byte array, added value format ${bitmap:WxH}.
First converting xlsx to pdf there was a problem with “imconvert”:
RestControllerExceptionHandler: Error checking image format
Cannot run program “imconvert”: error=2, No such file or directory
After installing ImageMagick on Docker and add sym link for convert - imconvert, i get another error: no ImagePreloader found (converting the .img to .png / .bmp directly at Docker was no problem).
Is there a solution or can you give me some advice, thank you in advance.
2020-05-06T12:41:21.685038700Z app[web.1]: Error checking image format
2020-05-06T12:41:21.685041917Z app[web.1]: The file format is not supported. No ImagePreloader found for file:/tmp/img9018058703129664189.img
2020-05-06T12:41:21.685044791Z app[web.1]: com.haulmont.reports.exception.ReportingException: An error occurred while inserting bitmap to xlsx file Report name [QuoteSheet]
2020-05-06T12:41:21.685047701Z app[web.1]: Error checking image format
2020-05-06T12:41:21.685050622Z app[web.1]: The file format is not supported. No ImagePreloader found for file:/tmp/img9018058703129664189.img
2020-05-06T12:41:21.685053269Z app[web.1]: at com.haulmont.reports.ReportingBean.createReportDocument(ReportingBean.java:361) ~[na:na]
2020-05-06T12:41:21.685056368Z app[web.1]: at com.haulmont.reports.ReportingBean.createReportDocument(ReportingBean.java:304) ~[na:na]
2020-05-06T12:41:21.685059125Z app[web.1]: at com.haulmont.reports.ReportingBean.createReport(ReportingBean.java:198) ~[na:na]
# grep -i preloader stacktrace.log
2020-05-06T12:41:21.663017427Z app[web.1]: Caused by: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for file:/tmp/img9018058703129664189.img
2020-05-06T12:41:21.675629101Z app[web.1]: The file format is not supported. No ImagePreloader found for file:/tmp/img9018058703129664189.img
I did a step forward: the problem is related to file org.apache.xmlgraphics.image.loader.spi.ImagePreloader in uber jar under LIB-INF/shared/META-INF/services. Normaly this file should content this lines:
this means that at runtime we don’t have the other preloader image loaded in the classloader.
I try to add the missing lines after uberjar creation finished and create a docker image, all works well.