Reputation: 4517
I'm using iText to generate a PDF file in a controller, but I need to insert an image from the public assets in the file using it's URL. Is there any way to get the asset URL from the controller?
Upvotes: 1
Views: 1218
Reputation: 14401
Reverse routing works for assets just like for controllers. This should provide you with required information:
controllers.routes.Assets.at("images/unchecked.png").absoluteURL(request())
You can read more about it in the section Reverse routing for public assets of the documentation.
Upvotes: 1