I have a grails application that will be rendering an html page into a pdf file and I have a flex application sitting on a server that is going to accept REST parameters and construct a graph based on the parameters (which will be formatted in JSON). What I want to do is make a call to the flex app with my parameters and have the flex app create the graph, render a JPEG of the graph, then send an image back to grails. In other words, I want to put an HTML img src="http://flex-app-location/graphing-tool.swf?param=1&param=2&param=3"/ that will render the image directly to the page so that my PDF Plugin in grails will render it into the PDF.
I know how to render the image in Flex but I don't know how to push this image back over HTTP so that it can be rendered as image data. Any suggestions?