image not displaying in PDF template using Spring Boot, flying saucer and Thymeleaf

后端 未结 4 1433
挽巷
挽巷 2021-01-13 23:21

I create a file pdf from html template using Spring Boot, flying saucer, thymeleaf. But image is not displaying in my file.

Project structure:

4条回答
  •  Happy的楠姐
    2021-01-14 00:14

    Try using Spring's classpath: prefix. This loads your file directly from the classpath, no matter if you are running from a .jar or within your IDE. Here is an example:

    mastercard
    

    More information about classpath: can be found in the official documentation.

提交回复
热议问题