I\'m doing the letter generation with iText (pdf/rtf) in java servlet and got a problem with accessing images. The images are in the WebContent/images folder. When I run it
For Kotlin, if the image is in the resources folder, you can also try the following:
resources
Image.getInstance(this::class.java.classLoader.getResourceAsStream("images/your_image.png").readBytes())