Open schmitch opened 7 years ago
Hi @schmitch ,
Annother use case would be to resolve the resources in memory, not necessary on disk. We use wkhtmltopdf and generate custom CSS per report. With wkhtmltopdf we need to write it to disk. Since it is a temporary file, it will be removed after the report is generated.
Having the ability to plug in resolvers, we might provide resources via another path like InputStreams and such.
Hello,
With the pluggable http stream factory, you can already do that for http/https urls. Possibly, you could also abuse the pluggable cache to provide Image
objects. See integration guide. However, it has become apparent from this thread that you should be able to do it with all url protocols and that we need a better API.
Currently it would be great if there was a way to have a CssProvider and a ImageProvider, that can actually resolve images and fonts.
Consider a HTML with multiple Images that have relative paths like:
images/my_image.png
it would be amazing if one could resolve them locally without making a URL request, like it's done in iText via:this would also give the possibility to create a image dynamically.
Same goes for CSS. (Currently the only way is to override the httpStreamImplementation, which works for Images only I guess. And a CSS should be providable without being inside the html)