danfickle / danfickle/openhtmltopdf
Suggestion: Image not rendering inside JAR in container Docker
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 423
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I spent some time to be able to generate a PDF using an image (in the resources) inside a JAR deployed in Docker.
In the localhost it was OK but when the service was deployed the image was not working. Because it is necessary to have write permissions in the _tmp_ folder.
In our case is prohibitive to change the file permissions, so it was necessary _to change the **ImageIO** to not use cache file._
Change used:
-> `ImageIO.setUseCache(false);`
As a suggestion: to allow in the PdfRendererBuilder change to use cache or not like the useFastMode( )
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at PdfRendererBuilder and trace how ImageIO handles image caching when rendering resources from a JAR in Docker. Reproduce the permission failure in a container, then verify that cache usage can be configured and that PDF generation succeeds without write access to the temporary folder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100