Rendering Grails Plugin
This plugin adds PDF, GIF, PNG and JPEG rendering facilities to Grails applications via the XHTML Renderer library.
Install
To install just add to the dependency block in the build.gradle
For Grails 7.x
implementation 'io.github.gpc:rendering:7.0.1'For Grails 3.x - 6.x
implementation 'org.grails.plugins:rendering:2.0.3'Usage
Rendering is either done directly via one of the «format»RenderingService services …
ByteArrayOutputStream bytes = pdfRenderingService.render(template: "/pdfs/report", model: [data: data])
Or via one of the render«format»() methods added to controllers …
renderPdf(template: "/pdfs/report", model: [report: reportObject], filename: reportObject.name)
Please see the User Guide for more information.
The plugin is released under the Apache License 2.0 and is produced under the Grails Plugin Collective. However, it does include LGPL libraries: XhtmlRenderer