I am using the Rendering plugin to generate a PDF from within a Web Flow. The problem is that I cannot get my end state to return the PDF response. If I call:
renderPdf(template: "/letter/generate/createpdf", model: [letter: flow.letter], filename: 'doc.pdf')
From within my end state action, it still tries to return an end state view. I can, however, put this in something like:
createpdf {
action {
renderPdf(template: "/letter/generate/createpdf", model: [letter: flow.letter], filename: 'doc.pdf')
return
}
on("success").to "finish"
}
But then of course I get a:
java.lang.IllegalStateException: getOutputStream() has already been called for this response
I basically want my end state to return the PDF file. Any ideas?