我创建了一个动态的PDF与GSP,我想添加一个图像,但我不知道如何做到这一点因为简单地在gsp中使用<img src="${resource(dir: 'images/vip', file: 'heading.png')}"/>
似乎没有工作。在创建电子邮件时,您在.sendMail
中使用inline 'pic1', 'image/jpg', resourceLoader.getResource("/images/bawHeader3.png").getFile()
,所以我想知道是否可以为pdf执行类似操作。这是我到目前为止:grails - 在控制器访问图像在pdf中使用
def downloadBooking() {
def result = Booking.findById(params.id)
renderPdf(template: "/pdf/booking/vipConfirmation", model : result)
}
上述工作正常,我只是不知道如何添加图像到它。另请告诉我如何访问gsp内的图像。
? –
不确定,我想我正在使用pdfRenderingService – PrintlnParams
好吧,这意味着您使用“grails pdf render” –