Memory-based PDF E-mail Attachement

Version: 6.0.6 - build 1232

Currently, we generate a Jasper Report, save it to disk as a PDF file, then attach the PDF file to an e-mail. Works great.

Is there a way to take the Jasper Report byte array output, for example:

var byteArray = plugins.jasperPluginRMI.runReport()

convert it a PDF file in memory, then attach it to an e-mail (we are trying to eliminate the intermediate step of creating a physical disk file)? If so, how?

Thanks in advance for any suggestions!

Try this:

var attachment = plugins.mail.createBinaryAttachment('MyFile.pdf', byteArray);

Thanks, Juan, that’s what I wanted…works great, too!