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

后端 未结 4 1405
挽巷
挽巷 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条回答
  •  孤街浪徒
    2021-01-14 00:23

    I faced the same issue but reading image file from disk is little costly, I would suggest you go with uri-data

    http://www.tothenew.com/blog/using-data-urls-for-embedding-images-in-flying-saucer-generated-pdfs/

    Because you anyway going to read image to generate PDF, better keep it in template.

提交回复
热议问题