I have been trying to use the following code (from an answer to a question someone else asked here) to get a PDF file converted into base64.
var pdf = new File('c:\\hl7\\Sample Report.pdf');
var bytes = qie.readFile(pdf);
//var s = new java.lang.String(bytes);
var encoder = new org.apache.commons.codec.binary.Base64(0, null, false);
var base64 = new java.lang.String(encoder.encode(bytes));
I get an error message "File is not defined"
Is there a syntax error in the above code or was the code provided in response to the previous question incorrect ?
Secondarily, how is this passed into a parameter map or similar so that i can embed the base64 into the message template I have created as a system variable.