简体   繁体   中英

Images are not displayed in PDF generated by apache fop

I am generating PDF files with the apache fop library (v2.2). If I run application from the Eclipse IDE all run without problems but if I generate JAR from the Eclipse IDE with library handling set to Extract required libraries into generated JAR and after that I will run JAR it will generate PDF files without images (text is visible as expected). First I thought that it is caused by invalid file paths, but If I use the base64 encoding of images directly in the XSL images are still not visible. If I generate JAR with library handling set to Package required libraries into generated JAR everything run OK but too slowly. Have you any idea which can be the reason of this?

I found out following problems:

  1. I was using my java.util.logging.Logger and did not see the results of the logger used in apache fop. I build simple testing application without this logger and got following error:

'SEVERE: Image not available. URI: image_name.jpg. Reason: org.apache.xmlgraphics.image.loader.ImageException: The file format is not supported. No ImagePreloader found for image_name.jpg(No context info available)'

  1. Description how to solve this problem for application build with maven is here . I am using external JARs, so I only changed the order of adding JARs in Java Build Path menu in Eclipse and eveything works.

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM